[mutter/bilelmoussaoui/without-xwayland: 33/34] wayland: Move Xwayland specific call to xwayland




commit 9af4064b3e27c7864242ee249a63fc0e9c1e0db8
Author: Bilal Elmoussaoui <belmouss redhat com>
Date:   Wed Jun 15 13:24:45 2022 +0200

    wayland: Move Xwayland specific call to xwayland

 src/wayland/meta-wayland.c          |  8 --------
 src/wayland/meta-xwayland-private.h |  5 -----
 src/wayland/meta-xwayland.c         | 11 ++++++++++-
 3 files changed, 10 insertions(+), 14 deletions(-)
---
diff --git a/src/wayland/meta-wayland.c b/src/wayland/meta-wayland.c
index e8fcd9b555..b54467f089 100644
--- a/src/wayland/meta-wayland.c
+++ b/src/wayland/meta-wayland.c
@@ -633,14 +633,6 @@ meta_wayland_compositor_new (MetaContext *context)
   meta_wayland_init_presentation_time (compositor);
   meta_wayland_activation_init (compositor);
 
-#ifdef HAVE_XWAYLAND
-  /* Xwayland specific protocol, needs to be filtered out for all other clients */
-  if (meta_xwayland_grab_keyboard_init (compositor))
-    wl_display_set_global_filter (compositor->wayland_display,
-                                  meta_xwayland_global_filter,
-                                  compositor);
-#endif
-
 #ifdef HAVE_WAYLAND_EGLSTREAM
   {
     gboolean should_enable_eglstream_controller = TRUE;
diff --git a/src/wayland/meta-xwayland-private.h b/src/wayland/meta-xwayland-private.h
index 53c3082d88..8841ef935d 100644
--- a/src/wayland/meta-xwayland-private.h
+++ b/src/wayland/meta-xwayland-private.h
@@ -57,9 +57,4 @@ gboolean meta_xwayland_start_xserver_finish (MetaXWaylandManager  *manager,
                                              GAsyncResult         *result,
                                              GError              **error);
 
-bool
-meta_xwayland_global_filter (const struct wl_client *client,
-                             const struct wl_global *global,
-                             void                   *data);
-
 #endif /* META_XWAYLAND_PRIVATE_H */
diff --git a/src/wayland/meta-xwayland.c b/src/wayland/meta-xwayland.c
index 5a1d085739..762ddab2a8 100644
--- a/src/wayland/meta-xwayland.c
+++ b/src/wayland/meta-xwayland.c
@@ -72,6 +72,10 @@ static void meta_xwayland_stop_xserver (MetaXWaylandManager *manager);
 static void
 meta_xwayland_set_primary_output (MetaX11Display *x11_display);
 
+static bool meta_xwayland_global_filter (const struct wl_client *client,
+                                         const struct wl_global *global,
+                                         void                   *data);
+
 void
 meta_xwayland_associate_window_with_surface (MetaWindow          *window,
                                              MetaWaylandSurface  *surface)
@@ -1117,6 +1121,11 @@ meta_xwayland_init (MetaXWaylandManager    *manager,
     g_signal_connect (compositor, "prepare-shutdown",
                       G_CALLBACK (meta_xwayland_shutdown), NULL);
 
+  /* Xwayland specific protocol, needs to be filtered out for all other clients */
+  meta_xwayland_grab_keyboard_init (compositor);
+  wl_display_set_global_filter (compositor->wayland_display,
+                                meta_xwayland_global_filter,
+                                compositor);
   return TRUE;
 }
 
@@ -1282,7 +1291,7 @@ meta_xwayland_handle_xevent (XEvent *event)
   return FALSE;
 }
 
-bool
+static bool
 meta_xwayland_global_filter (const struct wl_client *client,
                              const struct wl_global *global,
                              void                   *data)


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