From 8f52b0a8f4a0c8381dd23435eb73d640a698d07f Mon Sep 17 00:00:00 2001 From: Aleksey Lim Date: Tue, 29 Sep 2009 18:33:13 +0000 Subject: Present windows in non-active process #1423 --- (limited to 'src/sugar/graphics/window.py') diff --git a/src/sugar/graphics/window.py b/src/sugar/graphics/window.py index 967217a..885877d 100644 --- a/src/sugar/graphics/window.py +++ b/src/sugar/graphics/window.py @@ -118,6 +118,21 @@ class Window(gtk.Window): self.__unfullscreen_button_pressed) self._unfullscreen_button_timeout_id = None + def reveal(self): + """ Make window active + + In contrast with present(), brings window to the top + even after invoking on response on non-gtk events. + See #1423. + """ + if self.window is None: + self.show() + return + timestamp = gtk.get_current_event_time() + if not timestamp: + timestamp = gtk.gdk.x11_get_server_time(self.window) + self.window.focus(timestamp) + def fullscreen(self): palettegroup.popdown_all() if self._toolbar_box is not None: -- cgit v0.9.1