From 500a692e3b55e4f71216c354f57c3d896e2794d3 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Sat, 25 May 2019 12:00:47 +0200 Subject: [PATCH] core: Manage only X11 windows when (re)starting What "restart" means is somewhat different between x11 and wayland sessions. A X11 compositor may restart itself, thus having to manage again all the client windows that were running. A wayland compositor cannot restart itself, but might restart X11, in which case there's possibly a number of wayland clients, plus some x11 app that is being started. For the latter case, the assert will break, so just make it conditional. Also rename the function so it's more clear that it only affects X11 windows. https://gitlab.gnome.org/GNOME/mutter/merge_requests/709 --- src/core/display-private.h | 2 +- src/core/display.c | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/core/display-private.h b/src/core/display-private.h index d4ee5a192..ae8bb2ba6 100644 --- a/src/core/display-private.h +++ b/src/core/display-private.h @@ -264,7 +264,7 @@ struct _MetaDisplayClass gboolean meta_display_open (void); -void meta_display_manage_all_windows (MetaDisplay *display); +void meta_display_manage_all_xwindows (MetaDisplay *display); void meta_display_unmanage_windows (MetaDisplay *display, guint32 timestamp); diff --git a/src/core/display.c b/src/core/display.c index ea2dd762a..af10f7b27 100644 --- a/src/core/display.c +++ b/src/core/display.c @@ -646,7 +646,7 @@ meta_display_init_x11 (MetaDisplay *display, meta_x11_display_create_guard_window (x11_display); if (!display->display_opening) - meta_display_manage_all_windows (display); + meta_display_manage_all_xwindows (display); return TRUE; } @@ -797,7 +797,7 @@ meta_display_open (void) * we start out with no windows. */ if (!meta_is_wayland_compositor ()) - meta_display_manage_all_windows (display); + meta_display_manage_all_xwindows (display); if (old_active_xwindow != None) { @@ -2447,7 +2447,7 @@ meta_resize_gravity_from_grab_op (MetaGrabOp op) } void -meta_display_manage_all_windows (MetaDisplay *display) +meta_display_manage_all_xwindows (MetaDisplay *display) { guint64 *_children; guint64 *children; @@ -2461,7 +2461,8 @@ meta_display_manage_all_windows (MetaDisplay *display) for (i = 0; i < n_children; ++i) { - g_assert (META_STACK_ID_IS_X11 (children[i])); + if (!META_STACK_ID_IS_X11 (children[i])) + continue; meta_window_x11_new (display, children[i], TRUE, META_COMP_EFFECT_NONE); }