wayland: add inhibit shortcut mechanism
Add a mechanism to MetaWaylandSurface that inhibits compositor's own shortcuts when the surface has input focus, so that clients can receive all key events regardless of the compositor own shortcuts. This will help with implementing "fake" active grabs in Wayland and XWayland clients. https://bugzilla.gnome.org/show_bug.cgi?id=783342
This commit is contained in:
@@ -520,6 +520,24 @@ meta_window_wayland_init (MetaWindowWayland *wl_window)
|
||||
G_CALLBACK (appears_focused_changed), NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_window_wayland_force_restore_shortcuts (MetaWindow *window,
|
||||
ClutterInputDevice *source)
|
||||
{
|
||||
MetaWaylandCompositor *compositor = meta_wayland_compositor_get_default ();
|
||||
|
||||
meta_wayland_compositor_restore_shortcuts (compositor, source);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
meta_window_wayland_shortcuts_inhibited (MetaWindow *window,
|
||||
ClutterInputDevice *source)
|
||||
{
|
||||
MetaWaylandCompositor *compositor = meta_wayland_compositor_get_default ();
|
||||
|
||||
return meta_wayland_compositor_is_shortcuts_inhibited (compositor, source);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_window_wayland_class_init (MetaWindowWaylandClass *klass)
|
||||
{
|
||||
@@ -537,6 +555,8 @@ meta_window_wayland_class_init (MetaWindowWaylandClass *klass)
|
||||
window_class->update_main_monitor = meta_window_wayland_update_main_monitor;
|
||||
window_class->main_monitor_changed = meta_window_wayland_main_monitor_changed;
|
||||
window_class->get_client_pid = meta_window_wayland_get_client_pid;
|
||||
window_class->force_restore_shortcuts = meta_window_wayland_force_restore_shortcuts;
|
||||
window_class->shortcuts_inhibited = meta_window_wayland_shortcuts_inhibited;
|
||||
}
|
||||
|
||||
MetaWindow *
|
||||
|
Reference in New Issue
Block a user