Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated proximity for windows that are either focused or maxed. #769

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Settings.ui
Original file line number Diff line number Diff line change
Expand Up @@ -1757,6 +1757,7 @@
<item id="ALL_WINDOWS" translatable="yes">All windows</item>
<item id="FOCUSED_WINDOWS" translatable="yes">Focused windows</item>
<item id="MAXIMIZED_WINDOWS" translatable="yes">Maximized windows</item>
<item id="FOCUSED_OR_MAXIMIZED_WINDOWS" translatable="yes">Focused or maximized windows</item>
</items>
</object>
<packing>
Expand Down Expand Up @@ -4211,6 +4212,7 @@
<item id="ALL_WINDOWS" translatable="yes">All windows</item>
<item id="FOCUSED_WINDOWS" translatable="yes">Focused windows</item>
<item id="MAXIMIZED_WINDOWS" translatable="yes">Maximized windows</item>
<item id="FOCUSED_OR_MAXIMIZED_WINDOWS" translatable="yes">Focused or maximized windows</item>
</items>
</object>
<packing>
Expand Down
10 changes: 9 additions & 1 deletion proximity.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
<value value='0' nick='ALL_WINDOWS'/>
<value value='1' nick='FOCUSED_WINDOWS'/>
<value value='2' nick='MAXIMIZED_WINDOWS'/>
<value value='3' nick='FOCUSED_OR_MAXIMIZED_WINDOWS'/>
</enum>
<enum id='org.gnome.shell.extensions.dash-to-panel.fontWeight'>
<value value='0' nick='inherit'/>
Expand Down