Skip to content

Commit

Permalink
Immediately unminimize/focus if there's one window
Browse files Browse the repository at this point in the history
  • Loading branch information
1j01 committed Nov 17, 2021
1 parent 34c6223 commit 86dbfa9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/window-switcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@
}
$window_switcher_list.empty();
const window_els = $(".os-window").toArray(); // @TODO: support webamp, but only one entry; maybe should be based on tasks, not windows
if (window_els.length < 2) { // @TODO: or if there's only one window, but it's not focused
if (window_els.length === 1) {
window_els[0].$window.unminimize();
window_els[0].$window.focus(); // unminimize will focus but only if it was minimized
return;
}
if (window_els.length < 2) {
return;
}
window_els.sort((a, b) =>
Expand Down

0 comments on commit 86dbfa9

Please sign in to comment.