mirror of
https://github.com/labwc/labwc.git
synced 2026-03-18 05:33:53 -04:00
output: exit compositor when last nested output is destroyed
When running on the X11 or Wayland backend, each output corresponds to a window in the parent compositor. Unlike DRM outputs, these cannot be reconnected after being destroyed. Terminate the compositor when the last output is destroyed on these nested backends, matching the expected behavior when the user closes the window.
This commit is contained in:
parent
f0589810ad
commit
b36b4ab816
1 changed files with 12 additions and 0 deletions
12
src/output.c
12
src/output.c
|
|
@ -12,6 +12,7 @@
|
|||
#include <strings.h>
|
||||
#include <wlr/backend/drm.h>
|
||||
#include <wlr/backend/wayland.h>
|
||||
#include <wlr/backend/x11.h>
|
||||
#include <wlr/types/wlr_cursor.h>
|
||||
#include <wlr/types/wlr_drm_lease_v1.h>
|
||||
#include <wlr/types/wlr_gamma_control_v1.h>
|
||||
|
|
@ -195,6 +196,17 @@ handle_output_destroy(struct wl_listener *listener, void *data)
|
|||
*/
|
||||
output->wlr_output->data = NULL;
|
||||
|
||||
/*
|
||||
* On nested backends (X11/Wayland), outputs correspond to
|
||||
* windows and cannot be reconnected. Exit the compositor
|
||||
* when the last one is destroyed.
|
||||
*/
|
||||
if (wl_list_empty(&server->outputs)
|
||||
&& (wlr_output_is_x11(output->wlr_output)
|
||||
|| wlr_output_is_wl(output->wlr_output))) {
|
||||
wl_display_terminate(server->wl_display);
|
||||
}
|
||||
|
||||
/*
|
||||
* output->scene_output (if still around at this point) is
|
||||
* destroyed automatically when the wlr_output is destroyed
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue