Permalink
Browse files

main: withdraw_app_undo shows sonata on current workspace

Fix not showing (or showing at strange position) sonata if it's not
sticky ('Show window on all workspaces' option isn't set) and before
clicking on tray icon sonata was not on the current workspace.
  • Loading branch information...
1 parent 01917ad commit bb15b343eb501b0261daebbed280fa032f26cd3b Kirill Lashuk committed Aug 26, 2010
Showing with 7 additions and 0 deletions.
  1. +7 −0 sonata/main.py
View
@@ -2835,6 +2835,13 @@ def on_traytips_press(self, _widget, _event):
self.traytips._remove_timer()
def withdraw_app_undo(self):
+ # get desktop size
+ ws_width, ws_height = gtk.gdk.get_default_root_window().get_size()
+ # convert window coordinates to current workspace so sonata
+ # will always appear on the current workspace with the same
+ # position as it was before (may be on the other workspace)
+ self.config.x %= ws_width
+ self.config.y %= ws_height
self.window.move(self.config.x, self.config.y)
if not self.config.expanded:
self.notebook.set_no_show_all(True)

0 comments on commit bb15b34

Please sign in to comment.