[gimp/gimp-2-8] Bug 681709 - GimpContainer continuously scrolls on dnd failure on Windows.



commit a10b60e314bc1c6a7a2248666d7a0fe2dcf11eda
Author: Jehan <jehan girinstud io>
Date:   Mon Sep 30 05:23:23 2013 +1300

    Bug 681709 - GimpContainer continuously scrolls on dnd failure on Windows.
    
    The scroll timeout is looping forever if the drag ends by a failure
    event. For instance when hitting the Esc button during scrolling.
    (cherry picked from commit 3e082b356c77d8560fc79f29c77cf7ac17bb745e)

 app/widgets/gimpcontainertreeview-dnd.c |   15 +++++++++++++++
 app/widgets/gimpcontainertreeview-dnd.h |    4 ++++
 app/widgets/gimpcontainertreeview.c     |    3 +++
 3 files changed, 22 insertions(+), 0 deletions(-)
---
diff --git a/app/widgets/gimpcontainertreeview-dnd.c b/app/widgets/gimpcontainertreeview-dnd.c
index 16aa3d4..e93c103 100644
--- a/app/widgets/gimpcontainertreeview-dnd.c
+++ b/app/widgets/gimpcontainertreeview-dnd.c
@@ -255,6 +255,21 @@ gimp_container_tree_view_scroll_timeout (gpointer data)
 }
 
 void
+gimp_container_tree_view_drag_failed (GtkWidget             *widget,
+                                      GdkDragContext        *context,
+                                      GtkDragResult          result,
+                                      GimpContainerTreeView *tree_view)
+{
+  if (tree_view->priv->scroll_timeout_id)
+    {
+      g_source_remove (tree_view->priv->scroll_timeout_id);
+      tree_view->priv->scroll_timeout_id = 0;
+    }
+
+  gtk_tree_view_set_drag_dest_row (tree_view->view, NULL, 0);
+}
+
+void
 gimp_container_tree_view_drag_leave (GtkWidget             *widget,
                                      GdkDragContext        *context,
                                      guint                  time,
diff --git a/app/widgets/gimpcontainertreeview-dnd.h b/app/widgets/gimpcontainertreeview-dnd.h
index 1778e28..3d696da 100644
--- a/app/widgets/gimpcontainertreeview-dnd.h
+++ b/app/widgets/gimpcontainertreeview-dnd.h
@@ -22,6 +22,10 @@
 #define __GIMP_CONTAINER_TREE_VIEW_DND_H__
 
 
+void     gimp_container_tree_view_drag_failed (GtkWidget             *widget,
+                                               GdkDragContext        *context,
+                                               GtkDragResult          result,
+                                               GimpContainerTreeView *tree_view);
 void     gimp_container_tree_view_drag_leave  (GtkWidget             *widget,
                                                GdkDragContext        *context,
                                                guint                  time,
diff --git a/app/widgets/gimpcontainertreeview.c b/app/widgets/gimpcontainertreeview.c
index 67a8176..8e7470b 100644
--- a/app/widgets/gimpcontainertreeview.c
+++ b/app/widgets/gimpcontainertreeview.c
@@ -294,6 +294,9 @@ gimp_container_tree_view_constructed (GObject *object)
                     G_CALLBACK (gimp_container_tree_view_selection_changed),
                     tree_view);
 
+  g_signal_connect (tree_view->view, "drag-failed",
+                    G_CALLBACK (gimp_container_tree_view_drag_failed),
+                    tree_view);
   g_signal_connect (tree_view->view, "drag-leave",
                     G_CALLBACK (gimp_container_tree_view_drag_leave),
                     tree_view);


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