diff options
author | Jonas Ådahl <jadahl@gmail.com> | 2018-06-30 09:04:48 +0200 |
---|---|---|
committer | Jonas Ådahl <jadahl@gmail.com> | 2018-07-06 19:47:16 +0200 |
commit | 89727aa7479819976cee85b58eea5cd74c8ab551 (patch) | |
tree | 0037ffcde4f097765a5f073cb949a3da5cb20119 /src/wayland | |
parent | de5e7a717554d12aff944608b018ae9d2bddd2c0 (diff) | |
download | mutter-89727aa7479819976cee85b58eea5cd74c8ab551.tar.gz |
xwayland: Destroy selection bridge windows before closing X11 display
Listen to the "x11-display-closing" signal so we can destroy the X11
selection bridge related windows before the X11 display is gone.
https://bugzilla.gnome.org/show_bug.cgi?id=759538
Diffstat (limited to 'src/wayland')
-rw-r--r-- | src/wayland/meta-xwayland-private.h | 2 | ||||
-rw-r--r-- | src/wayland/meta-xwayland.c | 11 |
2 files changed, 10 insertions, 3 deletions
diff --git a/src/wayland/meta-xwayland-private.h b/src/wayland/meta-xwayland-private.h index ad2a2f6a7..fcf21ead6 100644 --- a/src/wayland/meta-xwayland-private.h +++ b/src/wayland/meta-xwayland-private.h @@ -29,7 +29,7 @@ meta_xwayland_start (MetaXWaylandManager *manager, struct wl_display *display); void -meta_xwayland_complete_init (void); +meta_xwayland_complete_init (MetaDisplay *display); void meta_xwayland_stop (MetaXWaylandManager *manager); diff --git a/src/wayland/meta-xwayland.c b/src/wayland/meta-xwayland.c index 955c57262..64550b189 100644 --- a/src/wayland/meta-xwayland.c +++ b/src/wayland/meta-xwayland.c @@ -550,9 +550,15 @@ out: return started; } +static void +on_x11_display_closing (MetaDisplay *display) +{ + meta_xwayland_shutdown_selection (); +} + /* To be called right after connecting */ void -meta_xwayland_complete_init (void) +meta_xwayland_complete_init (MetaDisplay *display) { /* We install an X IO error handler in addition to the child watch, because after Xlib connects our child watch may not be called soon @@ -561,6 +567,8 @@ meta_xwayland_complete_init (void) */ XSetIOErrorHandler (x_io_error); + g_signal_connect (display, "x11-display-closing", + G_CALLBACK (on_x11_display_closing), NULL); meta_xwayland_init_selection (); } @@ -570,7 +578,6 @@ meta_xwayland_stop (MetaXWaylandManager *manager) char path[256]; g_cancellable_cancel (manager->xserver_died_cancellable); - meta_xwayland_shutdown_selection (); g_clear_object (&manager->proc); g_clear_object (&manager->xserver_died_cancellable); |