[pitivi] timeline/elements: When keyframes are edited / added, don't react to



commit 87d3818b19ac272c0e597a9045efcfc73304ebcc
Author: Mathieu Duponchelle <mathieu duponchelle epitech eu>
Date:   Tue Jun 25 21:08:17 2013 +0200

    timeline/elements: When keyframes are edited / added, don't react to
    
    clicks on the stage.

 pitivi/timeline/elements.py |    2 ++
 pitivi/timeline/timeline.py |    7 +++++++
 2 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/pitivi/timeline/elements.py b/pitivi/timeline/elements.py
index f87f990..2df4785 100644
--- a/pitivi/timeline/elements.py
+++ b/pitivi/timeline/elements.py
@@ -673,10 +673,12 @@ class Line(Clutter.Actor):
     def _enterEventCb(self, actor, event):
         self.timelineElement.set_reactive(False)
         
self.timelineElement.timeline._container.embed.get_window().set_cursor(Gdk.Cursor.new(Gdk.CursorType.HAND1))
+        self.timelineElement.timeline._container.reactive = False
 
     def _leaveEventCb(self, actor, event):
         self.timelineElement.set_reactive(True)
         
self.timelineElement.timeline._container.embed.get_window().set_cursor(Gdk.Cursor.new(Gdk.CursorType.ARROW))
+        self.timelineElement.timeline._container.reactive = True
 
     def _motionEventCb(self, actor, event):
         pass
diff --git a/pitivi/timeline/timeline.py b/pitivi/timeline/timeline.py
index 255abc5..ebeb920 100644
--- a/pitivi/timeline/timeline.py
+++ b/pitivi/timeline/timeline.py
@@ -572,6 +572,7 @@ class Timeline(Gtk.VBox, Zoomable):
         self._projectmanager = None
         self._project = None
         self.pipeline = None
+        self.reactive = True
 
         self._createUi()
         self._createActions()
@@ -1091,6 +1092,12 @@ class Timeline(Gtk.VBox, Zoomable):
         position = self.pixelToNs(event.x - CONTROL_WIDTH + self.timeline._scroll_point.x)
         if self.app:
             self._seeker.seek(position)
+
+        # As actors are set to not reactive when keyframes are edited, get_actor_at_pos
+        # would return stage and we would wrongly empty our selection.
+        if not self.reactive:
+            return
+
         actor = self.stage.get_actor_at_pos(Clutter.PickMode.REACTIVE, event.x, event.y)
         if actor == stage:
             self.timeline.emptySelection()


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