From 56d8e5e748324cc1b2bc574803497b7c2432a37f Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Mon, 6 Aug 2007 09:23:45 -0400 Subject: [PATCH] Don't use gtk.get_current_event_time() as the timestamp for window.activate() gtk.get_current_event_time() will return 0 if there's no "current event" (which will happen if this is invoked from a SugarKeyGrabber callback, because that intercepts events below the gtk level). And libwnck will g_warn if we pass "0" to window.activate(). Since matchbox doesn't look at the timestamp anyway, it's simplest to just always pass "1" there. (Needed for part of #2159) --- shell/view/ActivityHost.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/shell/view/ActivityHost.py b/shell/view/ActivityHost.py index 1d3a32d6..fa3aaf61 100644 --- a/shell/view/ActivityHost.py +++ b/shell/view/ActivityHost.py @@ -65,10 +65,15 @@ class ActivityHost: pass def present(self): - self._window.activate(gtk.get_current_event_time()) + # wnck.Window.activate() expects a timestamp, but we don't + # always have one, and libwnck will complain if we pass "0", + # and matchbox doesn't look at the timestamp anyway. So we + # just always pass "1". + self._window.activate(1) def close(self): - self._window.close(gtk.get_current_event_time()) + # The "1" is a fake timestamp as with present() + self._window.close(1) def show_dialog(self, dialog): dialog.show()