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

Add "highest window per monitor" option to intellihide #784

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
1 change: 1 addition & 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="HIGHEST_WINDOW_PER_MONITOR" translatable="yes">Highest window per monitor</item>
</items>
</object>
<packing>
Expand Down
16 changes: 14 additions & 2 deletions 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,
HIGHEST_WINDOW_PER_MONITOR: 3
};

var ProximityWatch = Utils.defineClass({
Expand Down Expand Up @@ -238,7 +239,18 @@ var ProximityManager = Utils.defineClass({
},

_update: function(watch, metaWindows) {
if (watch.mode === Mode.FOCUSED_WINDOWS) {
if (watch.mode === Mode.HIGHEST_WINDOW_PER_MONITOR) {
if(metaWindows.length < 1) {
return false;
}
for (var i = metaWindows.length - 1; i >= 0; i--){
var mw = metaWindows[i];
if(mw.get_monitor() == watch.monitorIndex) {
return this._checkProximity(mw, watch);
}
}
return false;
} else if (watch.mode === Mode.FOCUSED_WINDOWS) {
return (this._focusedWindowInfo &&
this._checkIfHandledWindow(this._focusedWindowInfo.metaWindow) &&
this._checkProximity(this._focusedWindowInfo.metaWindow, watch));
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='HIGHEST_WINDOW_PER_MONITOR'/>
</enum>
<enum id='org.gnome.shell.extensions.dash-to-panel.fontWeight'>
<value value='0' nick='inherit'/>
Expand Down