[mutter/wip/carlosg/xwayland-on-demand: 149/159] core: Manage only X11 windows when (re)starting



commit 6bad23f376dad486d1d9106ab2ac568914ef9fd0
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sat May 25 12:00:47 2019 +0200

    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.

 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 7ff572a1c..d241e9090 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 d5024e5cb..08912d42e 100644
--- a/src/core/display.c
+++ b/src/core/display.c
@@ -648,7 +648,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;
 }
@@ -799,7 +799,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)
     {
@@ -2450,7 +2450,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;
@@ -2464,7 +2464,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);
     }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]