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
This commit is contained in:
Carlos Garnacho 2019-05-25 12:00:47 +02:00 committed by Carlos Garnacho
parent d3d1ff1aae
commit 500a692e3b
2 changed files with 6 additions and 5 deletions

View File

@ -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);

View File

@ -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);
}