[gnome-clocks] Try to prevent clutter from interfering with key events



commit 6241e753000f30fbb3799373d5ccc692c595553c
Author: Paolo Borelli <pborelli gnome org>
Date:   Thu Sep 27 22:14:07 2012 +0200

    Try to prevent clutter from interfering with key events
    
    Taken from a similar fix for gnome-boxes:
    https://bugzilla.gnome.org/show_bug.cgi?id=684988

 gnomeclocks/widgets.py |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/gnomeclocks/widgets.py b/gnomeclocks/widgets.py
index 3994453..4a6c48d 100644
--- a/gnomeclocks/widgets.py
+++ b/gnomeclocks/widgets.py
@@ -354,6 +354,13 @@ class Embed(GtkClutter.Embed):
         GtkClutter.Embed.__init__(self)
         self.set_use_layout_size(True)
 
+        # Set can-focus to false and override key-press and
+        # key-release so that we skip all Clutter key event
+        # handling and we let the contained gtk widget do
+        # their thing
+        # See https://bugzilla.gnome.org/show_bug.cgi?id=684988
+        self.set_can_focus(False)
+
         self.stage = self.get_stage()
 
         self._overlayLayout = Clutter.BinLayout()
@@ -400,6 +407,12 @@ class Embed(GtkClutter.Embed):
                              Clutter.BinAlignment.FILL)
         self._background.lower_bottom()
 
+    def do_key_press_event(self, event):
+        return False
+
+    def do_key_release_event(self, event):
+        return False
+
     def _spotlight_finished(self, actor, name, is_finished):
         self._viewActor.set_child_below_sibling(self._background, None)
         self._background.disconnect_by_func(self._spotlight_finished)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]