Skip to content

Commit

Permalink
Hide menu if it loses keyboard focus
Browse files Browse the repository at this point in the history
This will hopefully allow it to be dismissed by clicking elsewhere.
  • Loading branch information
DemiMarie committed Nov 25, 2024
1 parent 18901a0 commit 5d08789
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions qui/tray/domains.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,10 @@ def update_stats(self, memory_kb, cpu_usage):
class DomainTray(Gtk.Application):
''' A tray icon application listing all but halted domains. ” '''

def hide_menu(self, _unused_event):
self.tray_menu.hide()
return False

def __init__(self, app_name, qapp, dispatcher, stats_dispatcher):
super().__init__()
self.qapp = qapp
Expand All @@ -537,6 +541,7 @@ def __init__(self, app_name, qapp, dispatcher, stats_dispatcher):
_('<b>Qubes Domains</b>\nView and manage running domains.'))

self.tray_menu = Gtk.Menu()
self.widget_icon.connect('focus-out-event', self.hide_menu)

self.icon_cache = IconCache()

Expand Down

0 comments on commit 5d08789

Please sign in to comment.