mirror of
https://github.com/brl/mutter.git
synced 2025-07-28 20:48:03 +00:00
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
@@ -2223,7 +2223,7 @@ window_state_on_map (MetaWindow *window,
|
||||
/* don't initially focus windows that are intended to not accept
|
||||
* focus
|
||||
*/
|
||||
if (!(window->input || window->take_focus))
|
||||
if (!meta_window_is_focusable (window))
|
||||
{
|
||||
*takes_focus = FALSE;
|
||||
return;
|
||||
@@ -8529,6 +8529,15 @@ meta_window_shortcuts_inhibited (MetaWindow *window,
|
||||
return META_WINDOW_GET_CLASS (window)->shortcuts_inhibited (window, source);
|
||||
}
|
||||
|
||||
gboolean
|
||||
meta_window_is_focusable (MetaWindow *window)
|
||||
{
|
||||
if (window->unmanaging)
|
||||
return FALSE;
|
||||
|
||||
return META_WINDOW_GET_CLASS (window)->is_focusable (window);
|
||||
}
|
||||
|
||||
gboolean
|
||||
meta_window_is_stackable (MetaWindow *window)
|
||||
{
|
||||
|
Reference in New Issue
Block a user