Commit d2b2b34a authored by Carlos Garnacho's avatar Carlos Garnacho Committed by Matthias Clasen

scrolledwindow: improve v/hscrollbar proximity detection

Only horizontal coordinates are checked for the vertical scrollbar, and
vice versa.
parent 8b85db08
...@@ -954,10 +954,12 @@ event_close_to_indicator (GtkScrolledWindow *sw, ...@@ -954,10 +954,12 @@ event_close_to_indicator (GtkScrolledWindow *sw,
GdkEvent *event) GdkEvent *event)
{ {
GtkAllocation alloc, indicator_alloc; GtkAllocation alloc, indicator_alloc;
GtkScrolledWindowPrivate *priv;
GtkWidget *event_widget; GtkWidget *event_widget;
gint win_x, win_y; gint win_x, win_y;
gdouble x, y; gdouble x, y;
priv = sw->priv;
event_widget = gtk_get_event_widget (event); event_widget = gtk_get_event_widget (event);
gdk_event_get_coords (event, &x, &y); gdk_event_get_coords (event, &x, &y);
...@@ -978,14 +980,12 @@ event_close_to_indicator (GtkScrolledWindow *sw, ...@@ -978,14 +980,12 @@ event_close_to_indicator (GtkScrolledWindow *sw,
y = ycoord; y = ycoord;
} }
if (x < 0 || x > alloc.width || if ((indicator == &priv->hindicator &&
y < 0 || y > alloc.height) y >= win_y - 50 &&
return FALSE; y < win_y + indicator_alloc.height + 50) ||
(indicator == &priv->vindicator &&
if (x > win_x - 50 && x >= win_x - 50 &&
x < win_x + indicator_alloc.width + 50 && x < win_x + indicator_alloc.width + 50))
y > win_y - 50 &&
y < win_y + indicator_alloc.height + 50)
return TRUE; return TRUE;
return FALSE; return FALSE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment