mirror of
https://github.com/hyprwm/xdg-desktop-portal-hyprland.git
synced 2024-11-22 14:35:57 +01:00
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.
This commit is contained in:
parent
96d2789d8f
commit
e23e109e41
1 changed files with 13 additions and 0 deletions
|
@ -196,6 +196,19 @@ int main(int argc, char *argv[]) {
|
|||
goto error;
|
||||
}
|
||||
|
||||
if (pollfds[EVENT_LOOP_DBUS].revents & POLLHUP) {
|
||||
logprint(INFO, "event-loop: disconnected from dbus");
|
||||
break;
|
||||
}
|
||||
if (pollfds[EVENT_LOOP_WAYLAND].revents & POLLHUP) {
|
||||
logprint(INFO, "event-loop: disconnected from wayland");
|
||||
break;
|
||||
}
|
||||
if (pollfds[EVENT_LOOP_PIPEWIRE].revents & POLLHUP) {
|
||||
logprint(INFO, "event-loop: disconnected from pipewire");
|
||||
break;
|
||||
}
|
||||
|
||||
if (pollfds[EVENT_LOOP_DBUS].revents & POLLIN) {
|
||||
logprint(TRACE, "event-loop: got dbus event");
|
||||
do {
|
||||
|
|
Loading…
Reference in a new issue