Skip to content

Commit a522d99

Browse files
committed
fix newly opened windows covered by old windows
1 parent 0e729c6 commit a522d99

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

contents/code/main.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ function onActivated(client) {
6666
if (client == null) return;
6767
debug("\nactivated", client.caption);
6868
removeMinimized(client);
69-
minimizeOverlapping();
69+
minimizeOverlapping(client);
7070
restoreMinimized();
7171
}
7272

@@ -90,7 +90,7 @@ function onAdded(client) {
9090
function onRegeometrized(client) {
9191
debug("\nregeometrized", client && client.caption ? client.caption : client);
9292
removeMinimized(client);
93-
minimizeOverlapping();
93+
minimizeOverlapping(client);
9494
restoreMinimized();
9595
}
9696

@@ -118,9 +118,9 @@ function onRemoved(client) {
118118
///////////////////////
119119

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

0 commit comments

Comments
 (0)