]> spindle.queued.net Git - midori/commitdiff
Make sure x, y is set in KatzeScrolled button event
authorChristian Dywan <christian@twotoasts.de>
Wed, 23 Nov 2011 19:02:59 +0000 (20:02 +0100)
committerChristian Dywan <christian@twotoasts.de>
Thu, 24 Nov 2011 23:59:49 +0000 (00:59 +0100)
katze/katze-scrolled.c

index 4fe090b843a59e5f8dd0b1103808e44785808a79..582142ad199f2c00b61e41328722f4fc90114c5e 100644 (file)
@@ -466,14 +466,12 @@ button_press_event (GtkWidget*      widget,
     gint y;
     GdkModifierType mask;
 
-    if (!priv->drag_scrolling)
-        return FALSE;
-
-    if (event->button != 1)
+    if (!priv->drag_scrolling || event->button != 1)
         return FALSE;
 
     priv->press_received = TRUE;
-
+    gdk_window_get_pointer (gtk_widget_get_window (GTK_WIDGET (scrolled)),
+                            &x, &y, &mask);
     if (event->time - priv->previous_time < priv->dragging_stopped_delay &&
         gtk_drag_check_threshold (widget, priv->previous_x, priv->previous_y, x, y))
     {
@@ -482,8 +480,6 @@ button_press_event (GtkWidget*      widget,
             g_source_remove (priv->scrolling_timeout_id);
             priv->scrolling_timeout_id = 0;
         }
-        gdk_window_get_pointer (gtk_widget_get_window (GTK_WIDGET (scrolled)),
-                                &x, &y, &mask);
         /* do_motion_scroll (scrolled, widget, x, y, event->time); */
     }
     else
@@ -499,8 +495,6 @@ button_press_event (GtkWidget*      widget,
             priv->dragged = FALSE;
             priv->previous_time = event->time;
         }
-        gdk_window_get_pointer (gtk_widget_get_window (GTK_WIDGET (scrolled)),
-                                &x, &y, &mask);
         priv->start_x = priv->previous_x = priv->farest_x = x;
         priv->start_y = priv->previous_y = priv->farest_y = y;
         priv->start_time  = event->time;