[glade] Fixed drag&drop bug. A bogus drag was being triggered when resizing a widget in the workspace.



commit e82687bcc90c1122ecf376a790e9b366e2b69fcd
Author: Juan Pablo Ugarte <juanpablougarte gmail com>
Date:   Thu Jun 6 20:03:11 2013 -0300

    Fixed drag&drop bug. A bogus drag was being triggered when resizing a widget in the workspace.

 gladeui/glade-design-layout.c |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)
---
diff --git a/gladeui/glade-design-layout.c b/gladeui/glade-design-layout.c
index 565af5a..1d39521 100644
--- a/gladeui/glade-design-layout.c
+++ b/gladeui/glade-design-layout.c
@@ -2303,11 +2303,8 @@ _glade_design_layout_do_event (GladeDesignLayout *layout, GdkEvent *event)
     {
       GObject *source;
 
-      if (event->button.state & GDK_SHIFT_MASK)
-        {
-          priv->drag_source = NULL;
-        }
-      else if (data.gwidget && (source = glade_widget_get_object (data.gwidget)))
+      if (!(event->button.state & GDK_SHIFT_MASK) &&
+          data.gwidget && (source = glade_widget_get_object (data.gwidget)))
         {
           priv->drag_source = GTK_WIDGET (source);
 
@@ -2315,6 +2312,14 @@ _glade_design_layout_do_event (GladeDesignLayout *layout, GdkEvent *event)
                                             data.x, data.y,
                                             &priv->drag_x, &priv->drag_y);
         }
+      else
+        {
+          priv->drag_source = NULL;
+        }
+    }
+  else if (event->type == GDK_BUTTON_RELEASE && event->button.button == 1)
+    {
+      priv->drag_source = NULL;
     }
 
   _glade_design_view_freeze (priv->view);


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