Commit cc57ff06 authored by Thibault Saunier's avatar Thibault Saunier

timeline: Avoid having 2 layers with the same prio in the timeline

This is completely forbiden by GES and should never happen.

GES should not segfault when this case happens but we are anyway
going to replace the layer.priority API with a timeline.move_layer(),
basically because the current API was badly designed and gives to much
constraints on it user (ie. this bug can happen!).

(See for the GES API change
Reviewed-by: Alexandru Băluț's avatarAlex Băluț <>
Differential Revision:
parent 819c13f2
......@@ -1214,12 +1214,13 @@ class Timeline(Gtk.EventBox, Zoomable, Loggable):
assert 0 <= priority <= len(ges_layers)
new_ges_layer =
new_ges_layer.props.priority = priority
for ges_layer in ges_layers:
if priority <= ges_layer.get_priority():
ges_layer.props.priority += 1
return new_ges_layer
def dragEnd(self):
......@@ -868,7 +868,6 @@ class TestDragDropUndo(BaseTestUndoTimeline):
self.assertEqual(layers[0].get_clips(), [])
self.assertEqual(layers[1].get_clips(), [clip])
@skip("segfaults, see T7704")
def test_clip_dragged_to_create_layer_above(self):
timeline_ui = self.timeline_container.timeline
......@@ -915,7 +914,7 @@ class TestDragDropUndo(BaseTestUndoTimeline):
layers = self.timeline.get_layers()
self.assertEqual(len(layers), 2)
self.assertEqual(layers[0], self.layer)
self.assertEqual(layers[1], self.layer)
self.assertEqual(layers[0].get_clips(), [clip])
self.assertEqual(layers[1].get_clips(), [])
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment