Skip to content

Commit 98a3997

Browse files
committed
fix(launcher): Request that newest window be on top
1 parent 3d4285d commit 98a3997

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

src/launcher.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -224,22 +224,22 @@ export class Launcher extends search.Search {
224224

225225
if (windows.length > existing_windows) {
226226
let newest_window = null
227-
let newest_time = -1
227+
let newest_time = null
228228
for (const window of windows) {
229229
const this_time = window.get_user_time()
230-
if (newest_time < this_time) {
230+
if (newest_time === null || newest_time > this_time) {
231231
newest_window = window
232232
newest_time = this_time
233233
}
234234

235235
if (this_time === 0) {
236-
newest_window = window
236+
newest_window = window;
237237
break
238238
}
239239
}
240240

241241
if (newest_window) {
242-
shell_window.activate(true, DefaultPointerPosition.TopLeft, newest_window)
242+
this.ext.get_window(newest_window)?.activate(true);
243243
}
244244

245245
return false

src/window.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -608,10 +608,9 @@ export function activate(move_mouse: boolean, default_pointer_position: Config.D
608608
const workspace = win.get_workspace()
609609
if (!workspace) return
610610

611-
win.raise();
612611
win.unminimize();
613-
614612
workspace.activate_with_focus(win, global.get_current_time())
613+
win.raise()
615614

616615
if (move_mouse && !pointer_already_on_window(win)) {
617616
place_pointer_on(default_pointer_position, win)

0 commit comments

Comments
 (0)