From 1edef0219b4f5f40267a31ce78d11d6b87d6c5f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alberts=20Muktup=C4=81vels?= Date: Sun, 9 Oct 2022 14:07:49 +0300 Subject: display: ensure that tab group does not include wrong windows Make sure that we never put all windows in META_TAB_LIST_GROUP when focus_window is NULL. And to compare if windows have same group use meta_window_same_application. --- src/core/display.c | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/src/core/display.c b/src/core/display.c index 4168a828..48692357 100644 --- a/src/core/display.c +++ b/src/core/display.c @@ -164,8 +164,6 @@ static void prefs_changed_callback (MetaPreference pref, static void sanity_check_timestamps (MetaDisplay *display, guint32 known_good_timestamp); -MetaGroup* get_focussed_group (MetaDisplay *display); - /** * Destructor for MetaPingData structs. Will destroy the * event source for the struct as well. @@ -4561,15 +4559,6 @@ meta_display_window_has_pending_pings (MetaDisplay *display, return FALSE; } -MetaGroup* -get_focussed_group (MetaDisplay *display) -{ - if (display->focus_window) - return display->focus_window->group; - else - return NULL; -} - static inline gboolean in_normal_tab_chain_type (MetaWindow *window) { @@ -4596,11 +4585,14 @@ in_tab_chain (MetaWindow *window, } else if (type == META_TAB_LIST_GROUP) { - MetaGroup *group; + MetaWindow *focus_window; - group = get_focussed_group (window->display); + focus_window = window->display->focus_window; + + if (focus_window == NULL) + return FALSE; - if (group == NULL || meta_window_get_group (window) == group) + if (meta_window_same_application (window, focus_window)) return TRUE; } -- cgit v1.2.1