[pitivi/ges] Grab focus on the timeline canvas when clicking on the ruler



commit 84377ddb596f7a1997902825de6da11311f6ae6c
Author: Jean-FranÃois Fortin Tam <nekohayo gmail com>
Date:   Fri Apr 27 22:16:57 2012 -0400

    Grab focus on the timeline canvas when clicking on the ruler
    
    Fixes bug #674389

 pitivi/timeline/ruler.py |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/pitivi/timeline/ruler.py b/pitivi/timeline/ruler.py
index 3928154..a1acfeb 100644
--- a/pitivi/timeline/ruler.py
+++ b/pitivi/timeline/ruler.py
@@ -146,6 +146,11 @@ class ScaleRuler(gtk.DrawingArea, Zoomable, Loggable):
     def do_button_release_event(self, event):
         self.debug("button released at x:%d", event.x)
         self.pressed = False
+        # The distinction between the ruler and timeline canvas is theoretical.
+        # If the user interacts with the ruler, have the timeline steal focus
+        # from other widgets. This reactivates keyboard shortcuts for playback.
+        timeline = self.app.gui.timeline_ui
+        timeline._canvas.grab_focus(timeline._root_item)
         return False
 
     def do_motion_notify_event(self, event):



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