diff options
author | Alexander Mikhaylenko <alexm@gnome.org> | 2021-03-03 15:04:32 +0500 |
---|---|---|
committer | Alexander Mikhaylenko <alexm@gnome.org> | 2021-03-03 15:04:41 +0500 |
commit | d0cf3007c612610fb345bf71bb0c5929f6ae91a5 (patch) | |
tree | 644e14729e43e63a967659a53747e1f2bcc959bb | |
parent | 48de9796c2998808c448a2a1c095a1e4369d1d6f (diff) | |
download | gtk+-d0cf3007c612610fb345bf71bb0c5929f6ae91a5.tar.gz |
Revert "Add scaling adjustment for touch dragging a scrolled window"wip/exalm/scroll
This reverts commit d4943ef2fbc5a402bb5f43f40c93700b7263f07b.
This commit has broken scrolling in GtkTreeView. VTE has
`scroll-unit-pixels` property now, so the original issue is fixed
separately.
Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3707
-rw-r--r-- | gtk/gtkscrolledwindow.c | 36 |
1 files changed, 3 insertions, 33 deletions
diff --git a/gtk/gtkscrolledwindow.c b/gtk/gtkscrolledwindow.c index 1364cd46cd..bea7339f39 100644 --- a/gtk/gtkscrolledwindow.c +++ b/gtk/gtkscrolledwindow.c @@ -1005,9 +1005,7 @@ scrolled_window_drag_update_cb (GtkScrolledWindow *scrolled_window, GtkScrolledWindowPrivate *priv = scrolled_window->priv; GtkAdjustment *hadjustment; GtkAdjustment *vadjustment; - GtkScrollable *child; - GtkBorder border; - double dx, dy, scale, size; + gdouble dx, dy; gtk_scrolled_window_invalidate_overshoot (scrolled_window); @@ -1020,25 +1018,10 @@ scrolled_window_drag_update_cb (GtkScrolledWindow *scrolled_window, GTK_EVENT_SEQUENCE_CLAIMED); } - child = GTK_SCROLLABLE (gtk_bin_get_child (GTK_BIN (scrolled_window))); - hadjustment = gtk_range_get_adjustment (GTK_RANGE (priv->hscrollbar)); if (hadjustment && may_hscroll (scrolled_window)) { - if (child && gtk_widget_get_visible (child)) - { - size = gtk_widget_get_allocated_width (GTK_WIDGET (child)); - if (gtk_scrollable_get_border (child, &border)) - size -= border.left + border.right; - - scale = gtk_adjustment_get_page_size (hadjustment) / size; - } - else - { - scale = 1.0; - } - - dx = priv->drag_start_x - offset_x * scale; + dx = priv->drag_start_x - offset_x; _gtk_scrolled_window_set_adjustment_value (scrolled_window, hadjustment, dx); } @@ -1046,20 +1029,7 @@ scrolled_window_drag_update_cb (GtkScrolledWindow *scrolled_window, vadjustment = gtk_range_get_adjustment (GTK_RANGE (priv->vscrollbar)); if (vadjustment && may_vscroll (scrolled_window)) { - if (child && gtk_widget_get_visible (child)) - { - size = gtk_widget_get_allocated_height (GTK_WIDGET (child)); - if (gtk_scrollable_get_border (child, &border)) - size -= border.top + border.bottom; - - scale = gtk_adjustment_get_page_size (vadjustment) / size; - } - else - { - scale = 1.0; - } - - dy = priv->drag_start_y - offset_y * scale; + dy = priv->drag_start_y - offset_y; _gtk_scrolled_window_set_adjustment_value (scrolled_window, vadjustment, dy); } |