summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorOlivier Fourdan <ofourdan@redhat.com>2021-02-11 17:53:59 +0100
committerMarge Bot <marge-bot@gnome.org>2021-02-23 11:08:59 +0000
commit6438919a89a4d0a0430321bedd68689a2c2f6e90 (patch)
treef575c22adc606f711acb5b3d592797b2154aedce /src/core
parent9de36fed4dfa392b5c826fc73b97467c754d2e3c (diff)
downloadmutter-6438919a89a4d0a0430321bedd68689a2c2f6e90.tar.gz
window: Add "is_focus_async" API
X11 clients can use different models of input handling, of which some may not result focus being set synchronously. For such clients, meta_focus_window() will not change the focus itself but rely on the client itself to set the input focus on the desired window. Add a new MetaWindow API to check when dealing with such a window. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1716>
Diffstat (limited to 'src/core')
-rw-r--r--src/core/window-private.h2
-rw-r--r--src/core/window.c6
2 files changed, 8 insertions, 0 deletions
diff --git a/src/core/window-private.h b/src/core/window-private.h
index 39fd38d12..d1730c988 100644
--- a/src/core/window-private.h
+++ b/src/core/window-private.h
@@ -613,6 +613,7 @@ struct _MetaWindowClass
gboolean (*is_stackable) (MetaWindow *window);
gboolean (*can_ping) (MetaWindow *window);
gboolean (*are_updates_frozen) (MetaWindow *window);
+ gboolean (*is_focus_async) (MetaWindow *window);
MetaStackLayer (*calculate_layer) (MetaWindow *window);
@@ -883,4 +884,5 @@ void meta_window_force_restore_shortcuts (MetaWindow *window,
gboolean meta_window_shortcuts_inhibited (MetaWindow *window,
ClutterInputDevice *source);
gboolean meta_window_is_stackable (MetaWindow *window);
+gboolean meta_window_is_focus_async (MetaWindow *window);
#endif
diff --git a/src/core/window.c b/src/core/window.c
index 8c7f49b21..d99db949f 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -8631,6 +8631,12 @@ meta_window_is_stackable (MetaWindow *window)
return META_WINDOW_GET_CLASS (window)->is_stackable (window);
}
+gboolean
+meta_window_is_focus_async (MetaWindow *window)
+{
+ return META_WINDOW_GET_CLASS (window)->is_focus_async (window);
+}
+
MetaStackLayer
meta_window_calculate_layer (MetaWindow *window)
{