From 9d3b5dd56a79caad1a6c32dba9250f0aafded25f Mon Sep 17 00:00:00 2001 From: lenemter Date: Wed, 29 Mar 2023 12:30:21 +0900 Subject: [PATCH 1/2] DragDropAction: Check that actor was actually clicked --- lib/DragDropAction.vala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/DragDropAction.vala b/lib/DragDropAction.vala index ff7359754..3d47e61be 100644 --- a/lib/DragDropAction.vala +++ b/lib/DragDropAction.vala @@ -214,7 +214,7 @@ namespace Gala { actor.get_transformed_position (out x, out y); // release has happened within bounds of actor - if (x < ex && x + actor.width > ex && y < ey && y + actor.height > ey) { + if (clicked && x < ex && x + actor.width > ex && y < ey && y + actor.height > ey) { actor_clicked (event.get_button ()); } From 5f093499b11f9cd0884ead6692c916b3aaa16a37 Mon Sep 17 00:00:00 2001 From: lenemter Date: Wed, 29 Mar 2023 16:21:24 +0900 Subject: [PATCH 2/2] Fix ungrab_actor --- lib/DragDropAction.vala | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/DragDropAction.vala b/lib/DragDropAction.vala index 3d47e61be..9e098ae8f 100644 --- a/lib/DragDropAction.vala +++ b/lib/DragDropAction.vala @@ -218,9 +218,11 @@ namespace Gala { actor_clicked (event.get_button ()); } - ungrab_actor (); - clicked = false; - dragging = false; + if (clicked) { + ungrab_actor (); + clicked = false; + } + return Gdk.EVENT_STOP; } else if (dragging) { if (hovered != null) {