After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 597703 - Trim handles can get glued together
Trim handles can get glued together
Status: RESOLVED FIXED
Product: pitivi
Classification: Other
Component: General
0.13.3
Other Linux
: Normal normal
: 0.13.4
Assigned To: Pitivi maintainers
Pitivi maintainers
Depends on:
Blocks:
 
 
Reported: 2009-10-07 15:42 UTC by Tim Waugh
Modified: 2010-02-05 21:56 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
backtrace (1.16 KB, text/plain)
2009-10-07 15:42 UTC, Tim Waugh
Details

Description Tim Waugh 2009-10-07 15:42:53 UTC
Created attachment 144969 [details]
backtrace

See rhbz#527671:
  https://bugzilla.redhat.com/show_bug.cgi?id=527671

This only happened once and I haven't been able to reproduce it since.
Comment 1 Tim Waugh 2009-10-07 18:21:42 UTC
Found out how to reproduce this.

If the start trim handle of a timeline clip is dragged to meet the end trim handle, they will get "glued" together (it looks like the start handle jumps to the right-hand side of the end handle).

After that, trying to drag the handle on the left-hand side does nothing -- it's stuck there.

Trying to drag the handle on the right-hand side left gives the traceback in the attachment.

Continuing to drag it gives this traceback:

Traceback (most recent call last):
  • File "pitivi/ui/controller.py", line 131 in motion_notify_event
    event)))
  • File "pitivi/ui/trackobject.py", line 127 in set_pos
    self._context.setMode(self._getMode())
AttributeError: 'NoneType' object has no attribute 'setMode'

followed by these two when the drag operation finished:

Traceback (most recent call last):
  File "pitivi/ui/controller.py", line 140, in button_release_event
    self._drag_end(item, self._dragging, event)
  File "pitivi/ui/controller.py", line 181, in _drag_end
    self.drag_end(item, target, event)
  File "pitivi/ui/trackobject.py", line 119, in drag_end
    self._context.finish()
AttributeError: 'NoneType' object has no attribute 'finish'
Traceback (most recent call last):
  File "pitivi/ui/controller.py", line 140, in button_release_event
    self._drag_end(item, self._dragging, event)
  File "pitivi/ui/controller.py", line 183, in _drag_end
    if self._ptr_within and self._drag_threshold():
  File "pitivi/ui/controller.py", line 195, in _drag_threshold
    last = self.pos(self._dragging)
  File "pitivi/ui/controller.py", line 81, in pos
    bounds = item.get_bounds()
AttributeError: 'NoneType' object has no attribute 'get_bounds'
Comment 2 Alessandro Decina 2009-10-08 18:20:26 UTC
This workaround fixes the traceback. It doesn't fix the fundamental problem that we don't enforce a minimum length for clips in the timeline though.


diff --git a/pitivi/timeline/timeline.py b/pitivi/timeline/timeline.py
index cf6761e..f431536 100644
--- a/pitivi/timeline/timeline.py
+++ b/pitivi/timeline/timeline.py
@@ -1249,7 +1249,7 @@ class TrimStartContext(EditingContext):
         self.default_originals = self._saveValues([focus_timeline_object])
 
         ripple = self.timeline.getObjsBeforeTime(focus.start)
-        assert not focus.timeline_object in ripple
+        assert not focus.timeline_object in ripple or focus.duration == 0
         self.ripple_originals = self._saveValues(ripple)
         self.ripple_offsets = self._getOffsets(focus.start, focus.priority,
             ripple)
diff --git a/pitivi/ui/trackobject.py b/pitivi/ui/trackobject.py
index fd4e53c..3420a7c 100644
--- a/pitivi/ui/trackobject.py
+++ b/pitivi/ui/trackobject.py
@@ -398,6 +398,9 @@ class TrackObject(View, goocanvas.Group, Zoomable):
         y = (self.height + LAYER_SPACING) * self.element.priority
         self.set_simple_transform(x, y, 1, 0)
         width = self.nsToPixel(self.element.duration)
+        min_width = self.start_handle.props.width * 2
+        if width < min_width:
+            width = min_width
         w = width - self.end_handle.props.width
         self.name.props.clip_path = "M%g,%g h%g v%g h-%g z" % (
             0, 0, w, self.height, w)
Comment 3 Brandon Lewis 2009-12-09 00:14:28 UTC
commit ffdc5c39f6c9b5b7b41b6f31ed10a8a5a9a9e652
Author: Brandon Lewis <brandon_lewis@alum.berkeley.edu>
Date:   Thu Oct 29 15:10:22 2009 -0700

    timeline.py,ui.trackobject.py: check in alessandro's fix for 597703