window: Add is_focusable class method
Implement is_focusable for both x11 and wayland and just use this check so that we can abstract things more and be less dependent on window backend. https://gitlab.gnome.org/GNOME/mutter/merge_requests/421
This commit is contained in:

committed by
Marco Trevisan

parent
fdd531f307
commit
43633d6b2f
@@ -141,7 +141,7 @@ static void
|
||||
meta_window_wayland_focus (MetaWindow *window,
|
||||
guint32 timestamp)
|
||||
{
|
||||
if (window->input)
|
||||
if (meta_window_is_focusable (window))
|
||||
meta_x11_display_set_input_focus_window (window->display->x11_display,
|
||||
window,
|
||||
FALSE,
|
||||
@@ -585,6 +585,12 @@ meta_window_wayland_shortcuts_inhibited (MetaWindow *window,
|
||||
return meta_wayland_compositor_is_shortcuts_inhibited (compositor, source);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
meta_window_wayland_is_focusable (MetaWindow *window)
|
||||
{
|
||||
return window->input;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
meta_window_wayland_is_stackable (MetaWindow *window)
|
||||
{
|
||||
@@ -618,6 +624,7 @@ meta_window_wayland_class_init (MetaWindowWaylandClass *klass)
|
||||
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;
|
||||
window_class->is_focusable = meta_window_wayland_is_focusable;
|
||||
window_class->is_stackable = meta_window_wayland_is_stackable;
|
||||
window_class->are_updates_frozen = meta_window_wayland_are_updates_frozen;
|
||||
}
|
||||
|
Reference in New Issue
Block a user