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.
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.
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.
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)
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
```
../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
```
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.