summaryrefslogtreecommitdiff
path: root/src/wayland/meta-xwayland.c
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/meta-xwayland.c
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/meta-xwayland.c')
-rw-r--r--src/wayland/meta-xwayland.c26
1 files changed, 26 insertions, 0 deletions
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,