[gimp] app: fix weird pointer behavior when clicking out of lock popover.



commit 767674fc5bdfec628c992af6780992281ee879dc
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 4347fc80cf..19cf4bfb6f 100644
--- a/app/widgets/gimpitemtreeview.c
+++ b/app/widgets/gimpitemtreeview.c
@@ -1966,11 +1966,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]