Skip to content

Commit d48cfae

Browse files
committed
Hide menu if it loses keyboard focus
This will hopefully allow it to be dismissed by clicking elsewhere.
1 parent d075ac5 commit d48cfae

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

qui/tray/domains.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,10 @@ def update_stats(self, memory_kb, cpu_usage):
524524
class DomainTray(Gtk.Application):
525525
''' A tray icon application listing all but halted domains. ” '''
526526

527+
def hide_menu(self, _unused_event):
528+
self.tray_menu.hide()
529+
return False
530+
527531
def __init__(self, app_name, qapp, dispatcher, stats_dispatcher):
528532
super().__init__()
529533
self.qapp = qapp
@@ -537,6 +541,7 @@ def __init__(self, app_name, qapp, dispatcher, stats_dispatcher):
537541
_('<b>Qubes Domains</b>\nView and manage running domains.'))
538542

539543
self.tray_menu = Gtk.Menu()
544+
self.tray_menu.connect('focus-out-event', self.hide_menu)
540545

541546
self.icon_cache = IconCache()
542547

0 commit comments

Comments
 (0)