Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Tray icon visibility bugfix (bug 1253)
Tray icon is now displayed always (if this
option is enabled), even on startup. Moving
window from another virtual desktop is working too.
  • Loading branch information
neoascetic authored and thp committed Feb 28, 2011
1 parent a953368 commit c89f4c7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 deletions.
5 changes: 3 additions & 2 deletions src/gpodder/gtkui/desktop/trayicon.py
Expand Up @@ -131,10 +131,11 @@ def __on_left_click(self, widget, data=None):
self.__gpodder.uniconify_main_window()
else:
if not self.__gpodder.gPodder.is_active():
self.__gpodder.gPodder.present()
else:
self.__gpodder.uniconify_main_window()
else:
self.__gpodder.iconify_main_window()


def __get_status_icon(self, icon):
if icon in self.__icon_cache:
return self.__icon_cache[icon]
Expand Down
20 changes: 8 additions & 12 deletions src/gpodder/gui.py
Expand Up @@ -3492,14 +3492,12 @@ def on_manage_device_playlist(self, widget):
def show_hide_tray_icon(self):
if self.config.display_tray_icon and have_trayicon and self.tray_icon is None:
self.tray_icon = GPodderStatusIcon(self, gpodder.icon_file, self.config)
elif not self.config.display_tray_icon and self.tray_icon is not None:
elif not self.config.display_tray_icon and self.tray_icon:
self.tray_icon.set_visible(False)
del self.tray_icon
self.tray_icon = None

if self.config.minimize_to_tray and self.tray_icon:
self.tray_icon.set_visible(self.is_iconified())
elif self.tray_icon:
if self.tray_icon:
self.tray_icon.set_visible(True)

def on_itemShowAllEpisodes_activate(self, widget):
Expand Down Expand Up @@ -4120,18 +4118,16 @@ def on_uniconify(self):
if self.tray_icon:
self.gPodder.set_skip_taskbar_hint(False)
if self.config.minimize_to_tray:
self.tray_icon.set_visible(False)
self.tray_icon.set_visible(True)
else:
self.gPodder.set_skip_taskbar_hint(False)

def uniconify_main_window(self):
if self.is_iconified():
# We need to hide and then show the window in WMs like Metacity
# or KWin4 to move the window to the active workspace
# (see http://gpodder.org/bug/1125)
self.gPodder.hide()
self.gPodder.show()
self.gPodder.present()
# We need to hide and then show the window in WMs like Metacity
# or KWin4 to move the window to the active workspace
# (see http://gpodder.org/bug/1125)
self.gPodder.hide()
self.gPodder.present()

def iconify_main_window(self):
if not self.is_iconified():
Expand Down

0 comments on commit c89f4c7

Please sign in to comment.