Skip to content

Commit

Permalink
Tray: Let dbus call end and reply to caller
Browse files Browse the repository at this point in the history
Depending on timing we may never send a reply to the caller if we restart
immediately.
  • Loading branch information
infirit committed Sep 11, 2023
1 parent 9e48033 commit f7eb687
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion blueman/main/Tray.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ def do_quit(_: object) -> bool:

def do_activate(self) -> None:
if self._active:
GLib.timeout_add_seconds(1, lambda: os.execv(sys.argv[0], sys.argv))
logging.info("Already running, restarting instance")
os.execv(sys.argv[0], sys.argv)
return

Gio.bus_watch_name(Gio.BusType.SESSION, 'org.blueman.Applet', Gio.BusNameWatcherFlags.NONE,
self._on_name_appeared, self._on_name_vanished)
Expand Down

0 comments on commit f7eb687

Please sign in to comment.