[pitivi/1.0] viewer: Fix traceback when reselecting overlay



commit 56be868c0706445a1383af7739682f3164f79619
Author: Alexandru Băluț <alexandru balut gmail com>
Date:   Tue Apr 24 03:09:33 2018 +0200

    viewer: Fix traceback when reselecting overlay
    
    MoveScaleOverlay.on_button_press is called also for the click which
    deselects the selected overlay, in which case it's responsible for
    deselecting the overlay. In this case though it should not start an
    action log transaction.
    
    Fixes #2185

 pitivi/viewer/move_scale_overlay.py | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/pitivi/viewer/move_scale_overlay.py b/pitivi/viewer/move_scale_overlay.py
index 3b57be45..b4497ac6 100644
--- a/pitivi/viewer/move_scale_overlay.py
+++ b/pitivi/viewer/move_scale_overlay.py
@@ -412,10 +412,12 @@ class MoveScaleOverlay(Overlay):
         self.click_source_position = self.__get_source_position()
         self.__clicked_handle = None
 
-        self.__action_log.begin("Video position change",
-                                finalizing_action=CommitTimelineFinalizingAction(
-                                    self._source.get_timeline().get_parent()),
-                                toplevel=True)
+        if self.hovered_handle or self.__box_hovered:
+            self.__action_log.begin("Video position change",
+                                    finalizing_action=CommitTimelineFinalizingAction(
+                                        self._source.get_timeline().get_parent()),
+                                    toplevel=True)
+
         if self.hovered_handle:
             self.hovered_handle.on_click()
             self.__clicked_handle = self.hovered_handle


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