Skip to content

Commit

Permalink
only autotile windows from current monitor and only if they are not m…
Browse files Browse the repository at this point in the history
…inimized.

fixes #26 and fixes #27
  • Loading branch information
Shuairan authored and Shuairan committed Nov 3, 2014
1 parent ec08836 commit c382dc3
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -405,21 +405,28 @@ function getNotFocusedWindowsOfMonitor(monitor)
return Main.getTabList().filter(function(w) {
let wm_type = w.get_window_type();
let app = tracker.get_window_app(w);
if (app == null) { return false; }
if (w.minimized) { return false; }
let w_monitor = Main.layoutManager.monitors[w.get_monitor()];

if (app == null) { return false; }
if (w.minimized) { return false; }
if (w_monitor != monitor) { return false; }

return focusMetaWindow != w && w.get_wm_class() != null;
});
}

function getWindowsOfMonitor(monitor)
{
return Main.getTabList();
return Main.getTabList().filter(function(w) {
return Main.getTabList().filter(function(w) {
let w_monitor = Main.layoutManager.monitors[w.get_monitor()];
if (w.minimized) { return false; }
if (w_monitor != monitor) { return false; }

if (w.get_wm_class() == null) {
global.log(w.get_title() + " has no wm-class");
return false;
}
return true;
}
return true;
});
}

Expand Down

0 comments on commit c382dc3

Please sign in to comment.