From 6a1f9331f3bb6c9ea16f73b66513675638e7f698 Mon Sep 17 00:00:00 2001 From: Thejas Kiran P S Date: Tue, 14 Jun 2022 19:59:27 +0530 Subject: [PATCH] elements: Fix ctrl+click clears whole selection While selection we were checking if the clip belongs to a group or not and pass that single clip or all the clips belonging to its group to timeline.selection.set_selection(). But while unselecting we creates a temporary GES.Group to hold them. So in the above mentioned 'if case', it got confused as a group created by user and passed all elements inside it to be unselected. Fixes #2433 --- pitivi/timeline/elements.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pitivi/timeline/elements.py b/pitivi/timeline/elements.py index 6a47c2698..9a38d982f 100644 --- a/pitivi/timeline/elements.py +++ b/pitivi/timeline/elements.py @@ -1384,8 +1384,15 @@ class Clip(Gtk.EventBox, Zoomable, Loggable): else: self.app.gui.editor.switch_context_tab(self.ges_clip) - parent = self.ges_clip.get_toplevel_parent() - if parent is self.ges_clip: + parent = self.ges_clip.get_parent() # returns parent group + + # If the clip selected doesn't belong to any group, + # then select/unselect that clip only. + if ( + parent is None or + # Need this because selected clips are temporarily grouped together. + mode == UNSELECT and parent == self.ges_clip.get_toplevel_parent() + ): selection = [self.ges_clip] else: selection = [elem for elem in parent.get_children(True) -- GitLab