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)
This commit is contained in:
parent
88401d31b4
commit
56d8e5e748
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user