Make sure x, y is set in KatzeScrolled button event

This commit is contained in:
Christian Dywan 2011-11-23 20:02:59 +01:00
parent d76b209f68
commit e20a92e6ce

View file

@ -466,14 +466,12 @@ button_press_event (GtkWidget* widget,
gint y; gint y;
GdkModifierType mask; GdkModifierType mask;
if (!priv->drag_scrolling) if (!priv->drag_scrolling || event->button != 1)
return FALSE;
if (event->button != 1)
return FALSE; return FALSE;
priv->press_received = TRUE; 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 && if (event->time - priv->previous_time < priv->dragging_stopped_delay &&
gtk_drag_check_threshold (widget, priv->previous_x, priv->previous_y, x, y)) 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); g_source_remove (priv->scrolling_timeout_id);
priv->scrolling_timeout_id = 0; 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); */ /* do_motion_scroll (scrolled, widget, x, y, event->time); */
} }
else else
@ -499,8 +495,6 @@ button_press_event (GtkWidget* widget,
priv->dragged = FALSE; priv->dragged = FALSE;
priv->previous_time = event->time; 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_x = priv->previous_x = priv->farest_x = x;
priv->start_y = priv->previous_y = priv->farest_y = y; priv->start_y = priv->previous_y = priv->farest_y = y;
priv->start_time = event->time; priv->start_time = event->time;