diff options
author | Benjamin Otte <otte@redhat.com> | 2012-03-03 21:17:32 +0100 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2012-03-03 21:18:12 +0100 |
commit | 0794143f4142eb7dfebceddd8446cd37e36becda (patch) | |
tree | 539ae1b7fc3094cc75580bb1800260d2e8b28a85 /gtk/gtkiconview.c | |
parent | 861a9adbad2e9856e97c6144627a810aa3d12d38 (diff) | |
download | gtk+-0794143f4142eb7dfebceddd8446cd37e36becda.tar.gz |
iconview: Fix autoscroll
... when the iconview is not the only child in it's parent GdkWindow.
Diffstat (limited to 'gtk/gtkiconview.c')
-rw-r--r-- | gtk/gtkiconview.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/gtk/gtkiconview.c b/gtk/gtkiconview.c index 29a31ed766..acf14eef77 100644 --- a/gtk/gtkiconview.c +++ b/gtk/gtkiconview.c @@ -5946,22 +5946,22 @@ gtk_icon_view_autoscroll (GtkIconView *icon_view, GdkDevice *device) { GdkWindow *window; - gint px, py, x, y, width, height; + gint px, py, width, height; gint hoffset, voffset; window = gtk_widget_get_window (GTK_WIDGET (icon_view)); gdk_window_get_device_position (window, device, &px, &py, NULL); - gdk_window_get_geometry (window, &x, &y, &width, &height); + gdk_window_get_geometry (window, NULL, NULL, &width, &height); /* see if we are near the edge. */ - voffset = py - (y + 2 * SCROLL_EDGE_SIZE); + voffset = py - 2 * SCROLL_EDGE_SIZE; if (voffset > 0) - voffset = MAX (py - (y + height - 2 * SCROLL_EDGE_SIZE), 0); + voffset = MAX (py - (height - 2 * SCROLL_EDGE_SIZE), 0); - hoffset = px - (x + 2 * SCROLL_EDGE_SIZE); + hoffset = px - 2 * SCROLL_EDGE_SIZE; if (hoffset > 0) - hoffset = MAX (px - (x + width - 2 * SCROLL_EDGE_SIZE), 0); + hoffset = MAX (px - (width - 2 * SCROLL_EDGE_SIZE), 0); if (voffset != 0) gtk_adjustment_set_value (icon_view->priv->vadjustment, |