diff options
author | flavio <fdanesse@gmail.com> | 2012-10-20 02:23:11 (GMT) |
---|---|---|
committer | flavio <fdanesse@gmail.com> | 2012-10-20 02:23:11 (GMT) |
commit | 052765cd3d9e7bd40d560b7423ff5e9adefb7fe4 (patch) | |
tree | 98975bf1b96700441871c0eee871b4849f605e8d | |
parent | 18ab32ab9b93c06058d6301664c4005a052cf429 (diff) |
record the focus on sugar window
-rw-r--r-- | olpcgames/activity.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/olpcgames/activity.py b/olpcgames/activity.py index 7d8f40f..2bb3ef1 100644 --- a/olpcgames/activity.py +++ b/olpcgames/activity.py @@ -29,6 +29,8 @@ log = logging.getLogger( 'olpcgames.activity' ) from gi.repository import Gtk from gi.repository import Gdk +from gi.repository import GObject + import os from sugar3.activity import activity @@ -108,6 +110,12 @@ class PygameActivity(activity.Activity): canvas = self.build_canvas() self.connect( 'configure-event', canvas._translator.do_resize_event ) + GObject.idle_add(self.setup_init) + + def setup_init(self): + self.grab_focus() + self.queue_draw() + def make_global( self ): """Hack to make olpcgames.ACTIVITY point to us """ |