diff --git a/src/shell-global.c b/src/shell-global.c index 80f251272..7f74a34fd 100644 --- a/src/shell-global.c +++ b/src/shell-global.c @@ -832,6 +832,13 @@ entry_cursor_func (StEntry *entry, use_ibeam ? META_CURSOR_IBEAM : META_CURSOR_DEFAULT); } +static void +on_x11_display_closed (MetaDisplay *display, + ShellGlobal *global) +{ + g_signal_handlers_disconnect_by_data (global->stage, global); +} + void _shell_global_set_plugin (ShellGlobal *global, MetaPlugin *plugin) @@ -895,6 +902,10 @@ _shell_global_set_plugin (ShellGlobal *global, g_signal_connect (global->meta_display, "notify::focus-window", G_CALLBACK (focus_window_changed), global); + if (global->xdisplay) + g_signal_connect_object (global->meta_display, "x11-display-closing", + G_CALLBACK (on_x11_display_closed), global, 0); + backend = meta_get_backend (); settings = meta_backend_get_settings (backend); g_signal_connect (settings, "ui-scaling-factor-changed",