[gimp/wip/Jehan/layers-dockable-refresh: 53/74] app: fix weird pointer behavior when clicking out of lock popover.




commit 1fa1fc6cb685643080101ffe04d866e6f3483a02
Author: Jehan <jehan girinstud io>
Date:   Tue Jun 22 20:48:59 2021 +0200

    app: fix weird pointer behavior when clicking out of lock popover.
    
    It was like small drag'n drop were occuring, sometimes actually ending
    up in moving layers or the like.

 app/widgets/gimpitemtreeview.c | 7 +++++++
 1 file changed, 7 insertions(+)
---
diff --git a/app/widgets/gimpitemtreeview.c b/app/widgets/gimpitemtreeview.c
index 8280da8bd9..0342a4b6bd 100644
--- a/app/widgets/gimpitemtreeview.c
+++ b/app/widgets/gimpitemtreeview.c
@@ -1995,11 +1995,18 @@ gimp_item_tree_view_popover_button_press (GtkWidget        *widget,
       if (gtk_tree_path_compare (path, view->priv->lock_box_path) != 0 ||
           column != gtk_tree_view_get_column (GIMP_CONTAINER_TREE_VIEW (view)->view, 1))
         {
+          /* Propagate the press event to the tree view. */
           new_event = gdk_event_copy (event);
           g_object_unref (new_event->any.window);
           new_event->any.window     = g_object_ref (gtk_widget_get_window (GTK_WIDGET (tree_view->view)));
           new_event->any.send_event = TRUE;
+          gtk_main_do_event (new_event);
 
+          /* Also immediately pass a release event at same position.
+           * Without this, we get weird pointer as though a quick drag'n
+           * drop occured.
+           */
+          new_event->type = GDK_BUTTON_RELEASE;
           gtk_main_do_event (new_event);
 
           gdk_event_free (new_event);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]