From 70149ce8f979f18902c0dce1d4652cd4358fb225 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Csaba=20Gy=C3=B6rgyi?= Date: Sun, 3 Nov 2024 11:54:39 +0100 Subject: [PATCH] Prevent reparenting a tag to itself Sidebar.check_parent now checks if the drop target is the same tag we are moving. --- GTG/gtk/browser/sidebar.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/GTG/gtk/browser/sidebar.py b/GTG/gtk/browser/sidebar.py index 0830948b8..c0118a3f7 100644 --- a/GTG/gtk/browser/sidebar.py +++ b/GTG/gtk/browser/sidebar.py @@ -591,7 +591,10 @@ def drag_end(self, source, drag, unused): def check_parent(self, value, target) -> bool: - """Check to parenting a parent to its own children""" + """Check for parenting a tag to its own descendant or to itself.""" + + if value == target: + return False item = target while item.parent: