From b76fbde9cb2a9d79a15a18a8aa881e0e53f33c5e Mon Sep 17 00:00:00 2001 From: mtsoltan Date: Fri, 11 Oct 2019 03:08:26 +0200 Subject: [PATCH] Updated proximity for windows that are either focused or maxed. --- Settings.ui | 2 ++ proximity.js | 10 +++++++++- ...rg.gnome.shell.extensions.dash-to-panel.gschema.xml | 1 + 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Settings.ui b/Settings.ui index 6e371857..b02e1bfe 100644 --- a/Settings.ui +++ b/Settings.ui @@ -1757,6 +1757,7 @@ All windows Focused windows Maximized windows + Focused or maximized windows @@ -4211,6 +4212,7 @@ All windows Focused windows Maximized windows + Focused or maximized windows diff --git a/proximity.js b/proximity.js index a49dbd79..f826e370 100644 --- a/proximity.js +++ b/proximity.js @@ -33,7 +33,8 @@ const T1 = 'limitUpdateTimeout'; var Mode = { ALL_WINDOWS: 0, FOCUSED_WINDOWS: 1, - MAXIMIZED_WINDOWS: 2 + MAXIMIZED_WINDOWS: 2, + FOCUSED_OR_MAXIMIZED_WINDOWS: 3, }; var ProximityWatch = Utils.defineClass({ @@ -245,6 +246,13 @@ var ProximityManager = Utils.defineClass({ } else if (watch.mode === Mode.MAXIMIZED_WINDOWS) { return metaWindows.some(mw => mw.maximized_vertically && mw.maximized_horizontally && mw.get_monitor() == watch.monitorIndex); + } else if (watch.mode === Mode.FOCUSED_OR_MAXIMIZED_WINDOWS) { + let is_focused = (this._focusedWindowInfo && + this._checkIfHandledWindow(this._focusedWindowInfo.metaWindow) && + this._checkProximity(this._focusedWindowInfo.metaWindow, watch)); + let is_maximized = metaWindows.some(mw => mw.maximized_vertically && mw.maximized_horizontally && + mw.get_monitor() == watch.monitorIndex); + return is_focused || is_maximized; } //Mode.ALL_WINDOWS diff --git a/schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml b/schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml index 185842eb..e21d26bd 100644 --- a/schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml +++ b/schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml @@ -57,6 +57,7 @@ +