mirror of
https://github.com/brl/mutter.git
synced 2024-11-25 09:30:45 -05:00
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
This commit is contained in:
parent
de5e7a7175
commit
89727aa747
@ -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);
|
||||
|
@ -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);
|
||||
|
||||
|
@ -1005,7 +1005,7 @@ meta_x11_display_new (MetaDisplay *display, GError **error)
|
||||
|
||||
#ifdef HAVE_WAYLAND
|
||||
if (meta_is_wayland_compositor ())
|
||||
meta_xwayland_complete_init ();
|
||||
meta_xwayland_complete_init (display);
|
||||
#endif
|
||||
|
||||
if (meta_is_syncing ())
|
||||
|
Loading…
Reference in New Issue
Block a user