Skip to content

Commit 7ffbeac

Browse files
mmstickjackpot51
authored andcommitted
fix: Disallow opening the launcher when it's already open
1 parent 42102e9 commit 7ffbeac

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/keybindings.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@ export class Keybindings {
1616
this.ext = ext;
1717
this.global = {
1818
"activate-launcher": () => {
19+
// Do not allow opening the launcher twice
1920
// Ignore when a fullscreen window is active
20-
if (ext.focus_window()?.meta.is_fullscreen()) {
21+
if (ext.window_search.opened || ext.focus_window()?.meta.is_fullscreen()) {
2122
return
2223
}
2324

src/launcher.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ export class Launcher extends search.Search {
2929
service: null | service.LauncherService = null
3030
append_id: null | number = null
3131
active_menu: null | any = null
32+
opened: boolean = false
3233

3334
constructor(ext: Ext) {
3435
super()
@@ -42,6 +43,7 @@ export class Launcher extends search.Search {
4243
this.cancel = () => {
4344
ext.overlay.visible = false
4445
this.stop_services(ext)
46+
this.opened = false
4547
}
4648

4749
this.search = (pat: string) => {
@@ -293,17 +295,19 @@ export class Launcher extends search.Search {
293295
}
294296

295297
open(ext: Ext) {
298+
// Do not allow opening twice
296299
// Do not activate if the focused window is fullscreen
297-
if (ext.focus_window()?.meta.is_fullscreen()) {
300+
if (this.opened || ext.focus_window()?.meta.is_fullscreen()) {
298301
return
299302
}
300303

304+
this.opened = true
305+
301306
const active_monitor = ext.active_monitor()
302307
const mon_work_area = ext.monitor_work_area(active_monitor)
303308
const mon_area = ext.monitor_area(active_monitor)
304309
const mon_width = mon_area ? mon_area.width : mon_work_area.width
305310

306-
307311
super.cleanup()
308312

309313
this.start_services()

0 commit comments

Comments
 (0)