Skip to content

Commit

Permalink
fix newly opened windows covered by old windows
Browse files Browse the repository at this point in the history
  • Loading branch information
nclarius committed Oct 25, 2021
1 parent 0e729c6 commit a522d99
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions contents/code/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ function onActivated(client) {
if (client == null) return;
debug("\nactivated", client.caption);
removeMinimized(client);
minimizeOverlapping();
minimizeOverlapping(client);
restoreMinimized();
}

Expand All @@ -90,7 +90,7 @@ function onAdded(client) {
function onRegeometrized(client) {
debug("\nregeometrized", client && client.caption ? client.caption : client);
removeMinimized(client);
minimizeOverlapping();
minimizeOverlapping(client);
restoreMinimized();
}

Expand Down Expand Up @@ -118,9 +118,9 @@ function onRemoved(client) {
///////////////////////

// minimize all windows overlapped by active window
function minimizeOverlapping() {
// get active window
active = workspace.activeClient;
function minimizeOverlapping(active) {
// if no window is provided, set default to the active window
if (active == null || active == undefined) active = workspace.activeClient;
// don't act on windows that are dead or still undergoing geometry change
if (active == undefined || active == null || active.move || active.resize) return;
debug("try minimize for", active.caption);
Expand Down

0 comments on commit a522d99

Please sign in to comment.