From 41a7321d9a8ccfdf7993b08edf3a5ba27b62df9b Mon Sep 17 00:00:00 2001 From: fthx <23138504+fthx@users.noreply.github.com> Date: Sat, 30 Mar 2024 11:17:08 +0100 Subject: [PATCH] Focus app with many windows in overview --- extension.js | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/extension.js b/extension.js index e8dfefd..7c4d68d 100644 --- a/extension.js +++ b/extension.js @@ -267,20 +267,25 @@ export default class DockFromDashExtension { } break; default: - let app_has_focus = false; - let app_focused_window_index = 0; - for (var index = 0; index < app_windows.length; index++) { - if (app_windows[index].has_focus()) { - app_has_focus = true; - app_focused_window_index = index; + if (Main.overview.visible) { + this.app.activate(); + Main.overview.hide(); + } else { + let app_has_focus = false; + let app_focused_window_index = 0; + for (var index = 0; index < app_windows.length; index++) { + if (app_windows[index].has_focus()) { + app_has_focus = true; + app_focused_window_index = index; + } } - } - if (app_has_focus) { - let next_index = (app_focused_window_index + 1) % app_windows.length; - this.app.activate_window(app_windows[next_index], global.get_current_time()); - } else { - this.app.activate(); + if (app_has_focus) { + let next_index = (app_focused_window_index + 1) % app_windows.length; + this.app.activate_window(app_windows[next_index], global.get_current_time()); + } else { + this.app.activate(); + } } } }