Skip to content

Commit

Permalink
fix: emit signal to close existing window before opening new
Browse files Browse the repository at this point in the history
only needed when close_on_focus_out has been disabled
  • Loading branch information
friday committed Apr 28, 2024
1 parent ec58ead commit f99014b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ulauncher/ui/UlauncherApp.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from __future__ import annotations

import contextlib
import logging
import weakref
from typing import Any, cast
Expand Down Expand Up @@ -109,6 +110,9 @@ def show_notification(self, notification_id: str | None, title: str, body: str,

@events.on
def show_launcher(self) -> None:
# close existing window first (if any). suppress crash if no instance has been created
with contextlib.suppress(TypeError):
events.emit("window:close", save_query=True)
UlauncherWindow(application=self)

@events.on
Expand Down

0 comments on commit f99014b

Please sign in to comment.