diff options
author | Alberts Muktupāvels <alberts.muktupavels@gmail.com> | 2022-10-09 14:07:49 +0300 |
---|---|---|
committer | Alberts Muktupāvels <alberts.muktupavels@gmail.com> | 2022-10-22 11:14:53 +0000 |
commit | 1edef0219b4f5f40267a31ce78d11d6b87d6c5f8 (patch) | |
tree | c68f02b9e0eda30c63b5285ce1a11dd7f48e2af7 | |
parent | 094248b9063af9d54743dea881600728be8ebef8 (diff) | |
download | metacity-1edef0219b4f5f40267a31ce78d11d6b87d6c5f8.tar.gz |
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.
-rw-r--r-- | src/core/display.c | 20 |
1 files 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; } |