[gtk+] Better fix for keynav dnd



commit d77dcfb9b23857ce8bee00b965a1a0dbbce9d6de
Author: Matthias Clasen <mclasen redhat com>
Date:   Wed Dec 22 22:33:40 2010 -0500

    Better fix for keynav dnd
    
    With proper rounding, we can go back to a 'small step' of 1.

 gtk/gtkdnd.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtkdnd.c b/gtk/gtkdnd.c
index d0c2301..48d726b 100644
--- a/gtk/gtkdnd.c
+++ b/gtk/gtkdnd.c
@@ -4150,8 +4150,8 @@ gtk_drag_cancel (GtkDragSourceInfo *info, GtkDragResult result, guint32 time)
  *************************************************************/
 
 static gboolean
-gtk_drag_motion_cb (GtkWidget      *widget, 
-		    GdkEventMotion *event, 
+gtk_drag_motion_cb (GtkWidget      *widget,
+		    GdkEventMotion *event,
 		    gpointer        data)
 {
   GtkDragSourceInfo *info = (GtkDragSourceInfo *)data;
@@ -4170,7 +4170,9 @@ gtk_drag_motion_cb (GtkWidget      *widget,
   else
     screen = gdk_event_get_screen ((GdkEvent *)event);
 
-  gtk_drag_update (info, screen, event->x_root, event->y_root, (GdkEvent *) event);
+  x_root = (gint)(event->x_root + 0.5);
+  y_root = (gint)(event->y_root + 0.5);
+  gtk_drag_update (info, screen, x_root, y_root, (GdkEvent *) event);
 
   return TRUE;
 }
@@ -4184,7 +4186,7 @@ gtk_drag_motion_cb (GtkWidget      *widget,
  *************************************************************/
 
 #define BIG_STEP 20
-#define SMALL_STEP 2
+#define SMALL_STEP 1
 
 static gboolean
 gtk_drag_key_cb (GtkWidget         *widget, 



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