mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-14 06:10:21 +00:00
scrolledwindow: Calculate indicator coords relative to scrolledwindow
The event coordinates we get are relative to the scrolledwindow coordinates.
This commit is contained in:
parent
782477188a
commit
e54d8a6114
@ -1083,14 +1083,21 @@ event_close_to_indicator (GtkScrolledWindow *sw,
|
||||
{
|
||||
GtkScrolledWindowPrivate *priv;
|
||||
GtkAllocation indicator_alloc;
|
||||
GtkAllocation sw_alloc;
|
||||
gdouble x, y;
|
||||
gint distance;
|
||||
|
||||
priv = sw->priv;
|
||||
|
||||
gtk_widget_get_allocation (GTK_WIDGET (sw), &sw_alloc);
|
||||
gtk_widget_get_allocation (indicator->scrollbar, &indicator_alloc);
|
||||
gdk_event_get_coords (event, &x, &y);
|
||||
|
||||
/* Make indicator alloc relative to scrolledwindow alloc, which is also
|
||||
* what the event coords are relative to */
|
||||
indicator_alloc.x -= sw_alloc.x;
|
||||
indicator_alloc.y -= sw_alloc.y;
|
||||
|
||||
if (indicator->over)
|
||||
distance = INDICATOR_FAR_DISTANCE;
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user