Commit graph

333 commits

Author SHA1 Message Date
columbarius
ab8e3bea00 pipewire: stop announcing a range as the video size
We can only serve a video with a size as send from the compositor,
so no need to announce any range.
2021-07-02 08:58:13 +02:00
columbarius
dee06d015d pipewire: add the striped format inside of build_format 2021-07-02 08:58:13 +02:00
columbarius
773186d2ed pipewire: move enumformat creation into seperate function 2021-07-02 08:58:13 +02:00
GermainZ
668509e317 Fix potential memory corruption when reading bools
As per `man sd_bus_message_read`, boolean items should be read into an
int rather than a bool as the latter can cause memory corruption.
2021-07-01 13:49:31 +02:00
Simon Ser
e23e109e41 Handle POLLHUP
This makes xdpw exit when either the D-Bus daemon, the Wayland
compositor or Pipewire is shut down. This avoids having dangling
non-functional xdpw instances, e.g. when restarting the compositor.

To test, start Sway nested in Sway, run xdpw with
WAYLAND_DISPLAY=wayland-2, and exit the nested Sway.
2021-07-01 11:58:26 +02:00
columbarius
96d2789d8f screencast: don't rely on the structure of xdpw_screencast_instance to convert formats 2021-06-29 15:08:02 +02:00
columbarius
bb24b226e4 screencast: respect the maximal framerate negotiated by pipewire 2021-06-23 09:32:08 +02:00
columbarius
976fa8374d screencast: limit screencast framerate by output framerate 2021-06-23 09:32:08 +02:00
columbarius
6438edb7b9 config: handle missing HOME env variable gracefully
Fixes: https://github.com/emersion/xdg-desktop-portal-wlr/issues/149
2021-06-17 09:37:16 +02:00
Jan Beich
71730982da ci: drop FreeBSD workaround after 22af25749e
inih exposes required CFLAGS/LDFLAGS via pkg-config, so manually
adding /usr/local to search path is no longer necessary.
2021-06-01 18:24:28 +02:00
Simon Ser
65cb6d5630 build: bump version to 0.4.0
Forgot to do it. Again.
2021-06-01 17:34:08 +02:00
Simon Ser
28a82d0568 readme: update IRC channel 2021-05-26 08:35:38 +02:00
Tobias Jakobi
0d23a5ea15 screencast: move xdpw_pwr_stream_destroy() up
- keep the order of functions in-sync with the header
2021-05-24 10:03:40 +02:00
Tobias Jakobi
f60bdcef71 screencast: improve cleanup on error in xdpw_screencast_init()
- currently the cleanup can segfault due to uninitialized
  list objects
- introduce xdpw_pwr_context_destroy() and fixup goto logic
2021-05-24 10:03:40 +02:00
Tobias Jakobi
d2fa4aa5e7 screencast: protect against NULL stream in xdpw_pwr_stream_destroy()
- this allows repeated calls of xdpw_pwr_stream_destroy() on a
  single screencast instance
2021-05-24 10:03:40 +02:00
Tobias Jakobi
dbe71a66c7 screencast: bring function names in line with the wlroots guidelines
- no functional changes
2021-05-24 10:03:40 +02:00
columbarius
b20b9d76d7 config: fix format specifier for max_fps 2021-05-22 12:26:50 +02:00
columbarius
bbd4f9d2b1 doc: add note about the list character of env XDG_CURRENT_DESKTOP 2021-05-21 19:35:58 +02:00
columbarius
feede20314 config: parse XDG_CURRENT_DESKTOP as a list 2021-05-20 22:45:10 +02:00
columbarius
c60b2b6ca8 config: fix memory leak config_home_fallback 2021-05-06 11:52:16 +02:00
Simon Ser
efcbcb60aa contrib/systemd: add ConditionEnvironment
This makes it clear xdpw requires WAYLAND_DISPLAY to be set before
being started.

Inspired by the mako service [1].

[1]: https://github.com/emersion/mako/blob/master/contrib/systemd/mako.service
2021-05-03 18:17:29 -04:00
Simon Ser
884a2e808e readme: add dbus-update-activation-environment command
Add a dbus-update-activation-environment invocation that users can
add to their config file. This should work for most users, assuming
Sway, systemd, and D-Bus activation.

The --systemd flag also imports the variables to the systemd user
session.
2021-05-03 18:07:10 -04:00
Simon Ser
835a928bd4 readme: update "Manual startup" section
Add -r flag to xdpw to make sure any currently running process gets
replaced.

Remove the /usr/lib/xdg-desktop-portal invocation since xdpw can now be
replaced.

Adapt the wording to the latest xdpw changes.
2021-05-03 18:07:10 -04:00
Tobias Langendorf
5d4dd833a4 screenshot: implement PickColor method
closes #129
2021-05-03 23:56:06 +02:00
columbarius
47635b94eb screencast: add prompt to dmenu style default choosers 2021-05-03 15:58:40 +02:00
Tobias Langendorf
83086e9af8 screenshot: implement interactive option 2021-05-03 15:51:05 +02:00
columbarius
620946b320 config: add missing keys to print_config 2021-05-03 15:19:20 +02:00
columbarius
f1472350f0 doc: remove quotes from samples
inih doesn't strip them and sh will try to find the binary including the whitespaces
2021-05-03 15:19:20 +02:00
columbarius
22af25749e config: use inih instead if iniparser 2021-05-03 15:19:20 +02:00
Simon Ser
7f6b4090e0 Add -r flag to slurp
This prevents the user from selecting a custom region, and forces
them to select a full output.
2021-05-03 11:57:11 +02:00
Simon Ser
bb13697c01 Add wlroots to portal manifest UseIn list
XDG_CURRENT_DESKTOP can contain a list [1]. Allow users to
set a list such as XDG_CURRENT_DESKTOP=asdf:wlroots. That way, users
can use xdpw in their non-Sway compositor without specifying
XDG_CURRENT_DESKTOP=sway and without having to edit the portal
definition.

[1]: 9a2582d035/src/portal-impl.c (L189)
2021-04-23 16:51:07 +02:00
Simon Ser
5d3cf9a8fa Remove -o and -f options
These can be specified in the configuration file now.
2021-04-21 12:12:40 -04:00
columbarius
f978a6eb77 Revert "screencast: workaround corrupted output_list"
This reverts commit 94f1f5d0a8.
2021-04-19 15:42:50 +02:00
columbarius
e89c58c731 wlr_screencopy: make sure xdg_output_manager is supported 2021-04-19 15:42:50 +02:00
Stefano Ragni
ebb50839a5 wlr_screencast: fix return value on cmd failure 2021-04-18 19:56:54 +02:00
Simon Ser
9f7e59c80a Bump to v0.3.0 2021-04-18 17:17:13 +02:00
Simon Ser
af7cdec82d build: use has_headers in find_library()
This allows to make sure the library's header files are available.
2021-04-18 15:02:44 +02:00
Simon Ser
47f9e1ccea build: remove dirs from iniparser find_library() call
The docs say:

> By default the library is searched for in the system library directory (e.g.
> /usr/lib).

So it should already do the right thing.
2021-04-18 15:02:44 +02:00
Simon Ser
d1328e2f4b build: remove intermediate static library
We don't really need to build an intermediate static library, and
it's causing pain wrt. include directories and dependencies.
2021-04-18 15:02:44 +02:00
Simon Ser
f8f188a73e ci: add /usr/local to search paths on FreeBSD
Because of an upstream Meson bug [1], the /usr/local prefix used
by ports is not included in default Meson search paths. Do it
explicitly for now.

[1]: https://github.com/mesonbuild/meson/issues/4468
2021-04-18 15:02:44 +02:00
columbarius
5e4edae701 wlr_screencast: remove wl_display_dispatch
wl_display_dispatch is unnecessary and can cause hangs, if no new requests are queued
2021-04-17 16:25:54 +02:00
Simon Ser
4af11c7a4f readme: don't show PR status in CI badge 2021-04-17 11:58:29 +02:00
columbarius
ca46a98b86 wlr_screencast: add xdg_output_listener after output registration if possible 2021-04-17 11:33:48 +02:00
columbarius
3ca286b0b4 wlr_screencast: call wlr_remove_output only if global is an output 2021-04-17 11:33:48 +02:00
columbarius
d83431335d wlr_screencast: create clean xdpw_wlr_output and free on remove 2021-04-17 11:33:48 +02:00
Aleksei Bavshin
9ba958c7d2 Fix gcc warnings on invalid free call
```
../src/core/config.c: In function ‘finish_config’:
../src/core/config.c:26:9: error: ‘free’ called on pointer ‘config_7(D)’ with nonzero offset 16 [-Werror=free-nonheap-object]
   26 |         free(&config->screencast_conf.exec_before);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/core/config.c:27:9: error: ‘free’ called on pointer ‘config_7(D)’ with nonzero offset 24 [-Werror=free-nonheap-object]
   27 |         free(&config->screencast_conf.exec_after);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/core/config.c:28:9: error: ‘free’ called on pointer ‘config_7(D)’ with nonzero offset 32 [-Werror=free-nonheap-object]
   28 |         free(&config->screencast_conf.chooser_cmd);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
```
2021-04-10 10:50:24 +02:00
columbarius
94f1f5d0a8 screencast: workaround corrupted output_list 2021-04-02 15:07:38 +02:00
columbarius
d556426359 man: add entry for chooser_cmd and chooser_type 2021-04-02 15:07:38 +02:00
columbarius
9d78b21695 screencast: add outputchooser with config option
Supports "dmenu" chooser type, which is called with a dmenu type list
piped to stdin, "simple" type, which recieves nothing on stdin and
default, which tries the hardcoded choosers.
Choosers are required to return the name of the choosen output as given
by the xdg-output protocol.

Thanks to piater for closing overlooked pipes.
Thanks to ericonr for suggestions regarding fork and pipes.
2021-04-02 15:07:38 +02:00
David96
4c2d8fc808 Add exec_before and exec_after
Adds an option to execute some program before and after screencast (e.g.
for disabling notifications during a cast)
2021-03-16 23:44:08 +01:00