summaryrefslogtreecommitdiff
path: root/src/wayland
diff options
context:
space:
mode:
authorBilal Elmoussaoui <belmouss@redhat.com>2022-06-15 13:24:45 +0200
committerMarge Bot <marge-bot@gnome.org>2023-01-03 20:45:04 +0000
commit4bbad6063a76481fe0fd7c43775a7542c9a5683c (patch)
tree4eaa3aa9c390a712686f7e90ee0d9a477e8e8b0d /src/wayland
parent36f30341acb8450cc89cb7eba79a4b3c8534a43d (diff)
downloadmutter-4bbad6063a76481fe0fd7c43775a7542c9a5683c.tar.gz
wayland: Move Xwayland specific call to xwayland
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2399>
Diffstat (limited to 'src/wayland')
-rw-r--r--src/wayland/meta-wayland.c27
-rw-r--r--src/wayland/meta-xwayland.c26
2 files changed, 26 insertions, 27 deletions
diff --git a/src/wayland/meta-wayland.c b/src/wayland/meta-wayland.c
index 481789daf..942960a2b 100644
--- a/src/wayland/meta-wayland.c
+++ b/src/wayland/meta-wayland.c
@@ -504,25 +504,6 @@ meta_wayland_compositor_class_init (MetaWaylandCompositorClass *klass)
G_TYPE_NONE, 0);
}
-#ifdef HAVE_XWAYLAND
-static bool
-meta_xwayland_global_filter (const struct wl_client *client,
- const struct wl_global *global,
- void *data)
-{
- MetaWaylandCompositor *compositor = (MetaWaylandCompositor *) data;
- MetaXWaylandManager *xwayland_manager = &compositor->xwayland_manager;
-
- /* Keyboard grabbing protocol is for Xwayland only */
- if (client != xwayland_manager->client)
- return (wl_global_get_interface (global) !=
- &zwp_xwayland_keyboard_grab_manager_v1_interface);
-
- /* All others are visible to all clients */
- return true;
-}
-#endif
-
void
meta_wayland_override_display_name (const char *display_name)
{
@@ -654,14 +635,6 @@ meta_wayland_compositor_new (MetaContext *context)
meta_wayland_activation_init (compositor);
meta_wayland_transaction_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.c b/src/wayland/meta-xwayland.c
index 08156c07e..9faeab297 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);
static MetaMonitorManager *
monitor_manager_from_x11_display (MetaX11Display *x11_display)
@@ -1122,6 +1126,11 @@ meta_xwayland_init (MetaXWaylandManager *manager,
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;
}
@@ -1291,6 +1300,23 @@ meta_xwayland_manager_handle_xevent (MetaXWaylandManager *manager,
return FALSE;
}
+static bool
+meta_xwayland_global_filter (const struct wl_client *client,
+ const struct wl_global *global,
+ void *data)
+{
+ MetaWaylandCompositor *compositor = (MetaWaylandCompositor *) data;
+ MetaXWaylandManager *xwayland_manager = &compositor->xwayland_manager;
+
+ /* Keyboard grabbing protocol is for Xwayland only */
+ if (client != xwayland_manager->client)
+ return (wl_global_get_interface (global) !=
+ &zwp_xwayland_keyboard_grab_manager_v1_interface);
+
+ /* All others are visible to all clients */
+ return true;
+}
+
gboolean
meta_xwayland_signal (MetaXWaylandManager *manager,
int signum,