summaryrefslogtreecommitdiff
path: root/src/x11/meta-x11-display.c
diff options
context:
space:
mode:
authorJonas Ã…dahl <jadahl@gmail.com>2022-05-30 23:20:37 +0200
committerMarge Bot <marge-bot@gnome.org>2022-09-19 14:46:01 +0000
commit6edb399b2b91647969f91338baa31b74221ca790 (patch)
treea0e4b428553158b914555302b25104ad87d34aba /src/x11/meta-x11-display.c
parentfc8a4afc450fc1e36723a3c47ed58022dcf4720d (diff)
downloadmutter-6edb399b2b91647969f91338baa31b74221ca790.tar.gz
x11-display: Keep track ourself if we're restarting
We still set the global state, so that e.g. GNOME Shell can continue consuming it, but it looks a bit awkward to rely on a global state inside a single function. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2619>
Diffstat (limited to 'src/x11/meta-x11-display.c')
-rw-r--r--src/x11/meta-x11-display.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/x11/meta-x11-display.c b/src/x11/meta-x11-display.c
index f2b88c6ba..9793897d1 100644
--- a/src/x11/meta-x11-display.c
+++ b/src/x11/meta-x11-display.c
@@ -1137,6 +1137,7 @@ meta_x11_display_new (MetaDisplay *display,
guint32 timestamp;
Atom atom_restart_helper;
Window restart_helper_window = None;
+ gboolean is_restart = FALSE;
GdkDisplay *gdk_display;
MetaBackend *backend = meta_get_backend ();
MetaMonitorManager *monitor_manager =
@@ -1202,7 +1203,10 @@ meta_x11_display_new (MetaDisplay *display,
atom_restart_helper = XInternAtom (xdisplay, "_MUTTER_RESTART_HELPER", False);
restart_helper_window = XGetSelectionOwner (xdisplay, atom_restart_helper);
if (restart_helper_window)
- meta_set_is_restart (TRUE);
+ {
+ is_restart = TRUE;
+ meta_set_is_restart (TRUE);
+ }
x11_display = g_object_new (META_TYPE_X11_DISPLAY, NULL);
x11_display->gdk_display = gdk_display;
@@ -1299,7 +1303,7 @@ meta_x11_display_new (MetaDisplay *display,
/* Now that we've gotten taken a reference count on the COW, we
* can close the helper that is holding on to it */
- if (meta_is_restart ())
+ if (is_restart)
XSetSelectionOwner (xdisplay, atom_restart_helper, None, META_CURRENT_TIME);
/* Handle creating a no_focus_window for this screen */