re-add trayicon to systray when it is destroyed. Fixes #2121
This commit is contained in:
parent
873bedd221
commit
1ef77d8e5d
|
@ -235,7 +235,8 @@ class Systray:
|
|||
self.added_hide_menuitem = True
|
||||
|
||||
else: # GNU and Unices
|
||||
self.systray_context_menu.popup(None, None, None, event.button, event.time)
|
||||
self.systray_context_menu.popup(None, None, None, event.button,
|
||||
event.time)
|
||||
self.systray_context_menu.show_all()
|
||||
|
||||
def on_show_all_events_menuitem_activate(self, widget):
|
||||
|
@ -341,9 +342,15 @@ class Systray:
|
|||
self.tooltip.id == position:
|
||||
self.tooltip.hide_tooltip()
|
||||
|
||||
def on_tray_destroyed(self, widget):
|
||||
'''re-add trayicon when systray is destroyed'''
|
||||
self.t = None
|
||||
self.show_icon()
|
||||
|
||||
def show_icon(self):
|
||||
if not self.t:
|
||||
self.t = trayicon.TrayIcon('Gajim')
|
||||
self.t.connect('destroy', self.on_tray_destroyed)
|
||||
eb = gtk.EventBox()
|
||||
# avoid draw seperate bg color in some gtk themes
|
||||
eb.set_visible_window(False)
|
||||
|
|
Loading…
Reference in New Issue