Skip to content

Commit

Permalink
GTK problems with dynamic menus bug in device widget
Browse files Browse the repository at this point in the history
Ported a workaround from domains widget to the devices widget.
The menu is now re-created (because no amount of forcing
redraws is accepted by Gtk as enough).

hopefully fixes QubesOS/qubes-issues#2970
  • Loading branch information
marmarta committed Feb 6, 2019
1 parent 2dfa8f6 commit 11cf897
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions qui/tray/devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,16 @@ def __init__(self, app_name, qapp, dispatcher):
'<b>Qubes Devices</b>\nView and manage devices.')

def show_menu(self, _, event):
# this awkward hack is used to workaround a Gtk bug
# that seems to manifest when the widget icon in placed
# on bottom of the screen
menu = Gtk.Menu()
for item in self.tray_menu.get_children():
self.tray_menu.remove(item)
menu.add(item)
menu.show_all()
self.tray_menu = menu

self.tray_menu.popup(None, # parent_menu_shell
None, # parent_menu_item
None, # func
Expand Down

0 comments on commit 11cf897

Please sign in to comment.