[gimp] app: in GimpPanedBox, don't accept drag contexts with unsupported targets



commit e38010b2d1d9a40b5d42c2986bf356565a5465b6
Author: Ell <ell_se yahoo com>
Date:   Mon May 18 18:14:37 2020 +0300

    app: in GimpPanedBox, don't accept drag contexts with unsupported targets
    
    ... to avoid both highlighting the droppable areas during darg, and
    crashing on drop.

 app/widgets/gimppanedbox.c | 9 +++++++++
 1 file changed, 9 insertions(+)
---
diff --git a/app/widgets/gimppanedbox.c b/app/widgets/gimppanedbox.c
index 3af033aa7f..6ba73c8c9e 100644
--- a/app/widgets/gimppanedbox.c
+++ b/app/widgets/gimppanedbox.c
@@ -282,6 +282,12 @@ gimp_paned_box_get_handle_drag (GimpPanedBox   *paned_box,
       return FALSE;
     }
 
+  if (gtk_drag_dest_find_target (GTK_WIDGET (paned_box), context, NULL) ==
+      GDK_NONE)
+    {
+      return FALSE;
+    }
+
   gtk_widget_get_allocation (GTK_WIDGET (paned_box), &allocation);
 
   /* See if we're at the edge of the dock If there are no dockables,
@@ -504,6 +510,9 @@ gimp_paned_box_drag_drop (GtkWidget      *widget,
 
   target = gtk_drag_dest_find_target (widget, context, NULL);
 
+  if (target == GDK_NONE)
+    return FALSE;
+
   gtk_drag_get_data (widget, context, target, time);
 
   return TRUE;


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