[mutter/wip/carlosg/xwayland-on-demand: 9/16] compositor: Add explicit API call to redirect X11 windows



commit 319f7f5b63633a94da9e9c53f9a0d6d804213fc1
Author: Carlos Garnacho <carlosg gnome org>
Date:   Fri May 24 21:04:56 2019 +0200

    compositor: Add explicit API call to redirect X11 windows
    
    This is not useful yet, but will be when Xwayland may restart
    
    https://gitlab.gnome.org/GNOME/mutter/merge_requests/709

 src/compositor/compositor-private.h |  2 ++
 src/compositor/compositor.c         | 12 ++++++++++--
 src/core/display.c                  |  2 ++
 3 files changed, 14 insertions(+), 2 deletions(-)
---
diff --git a/src/compositor/compositor-private.h b/src/compositor/compositor-private.h
index 07fbf5119..821f1dff0 100644
--- a/src/compositor/compositor-private.h
+++ b/src/compositor/compositor-private.h
@@ -74,4 +74,6 @@ MetaInhibitShortcutsDialog * meta_compositor_create_inhibit_shortcuts_dialog (Me
 
 void meta_compositor_locate_pointer (MetaCompositor *compositor);
 
+void meta_compositor_redirect_x11_windows (MetaCompositor *compositor);
+
 #endif /* META_COMPOSITOR_PRIVATE_H */
diff --git a/src/compositor/compositor.c b/src/compositor/compositor.c
index aae717789..cbb0ab6df 100644
--- a/src/compositor/compositor.c
+++ b/src/compositor/compositor.c
@@ -516,6 +516,15 @@ redirect_windows (MetaX11Display *x11_display)
     }
 }
 
+void
+meta_compositor_redirect_x11_windows (MetaCompositor *compositor)
+{
+  MetaDisplay *display = compositor->display;
+
+  if (display->x11_display)
+    redirect_windows (display->x11_display);
+}
+
 void
 meta_compositor_manage (MetaCompositor *compositor)
 {
@@ -595,8 +604,7 @@ meta_compositor_manage (MetaCompositor *compositor)
       compositor->have_x11_sync_object = meta_sync_ring_init (xdisplay);
     }
 
-  if (display->x11_display)
-    redirect_windows (display->x11_display);
+  meta_compositor_redirect_x11_windows (compositor);
 
   compositor->plugin_mgr = meta_plugin_manager_new (compositor);
 }
diff --git a/src/core/display.c b/src/core/display.c
index af10f7b27..bd7f10b6d 100644
--- a/src/core/display.c
+++ b/src/core/display.c
@@ -648,6 +648,8 @@ meta_display_init_x11 (MetaDisplay  *display,
   if (!display->display_opening)
     meta_display_manage_all_xwindows (display);
 
+  meta_compositor_redirect_x11_windows (display->compositor);
+
   return TRUE;
 }
 


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