After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 730730 - scrolling is broken when sharing adjustments
scrolling is broken when sharing adjustments
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkScrolledWindow
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
: 726795 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2014-05-25 19:39 UTC by Stefan Sauer (gstreamer, gtkdoc dev)
Modified: 2014-10-10 00:19 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
fix scrolling with shared adjustment (1.53 KB, patch)
2014-05-25 19:39 UTC, Stefan Sauer (gstreamer, gtkdoc dev)
none Details | Review
GtkScrolledWindow: Allow scrolling without bars (12.14 KB, patch)
2014-10-05 03:41 UTC, Matthias Clasen
committed Details | Review
Add an example for synchronized scrolling (3.08 KB, patch)
2014-10-05 03:41 UTC, Matthias Clasen
none Details | Review
Add an experiment for overlay scrollbars (5.25 KB, patch)
2014-10-05 03:41 UTC, Matthias Clasen
none Details | Review

Description Stefan Sauer (gstreamer, gtkdoc dev) 2014-05-25 19:39:22 UTC
Created attachment 277158 [details] [review]
fix scrolling with shared adjustment

Look at the standalone test app at:
https://github.com/Buzztrax/buzztrax/blob/master/design/gui/syncviews.c
Comment 1 Stefan Sauer (gstreamer, gtkdoc dev) 2014-05-27 19:26:56 UTC
To test the patch:

wget https://raw.githubusercontent.com/Buzztrax/buzztrax/master/design/gui/syncviews.c
gcc -Wall -g syncviews.c -o syncviews `pkg-config gtk+-3.0 --cflags --libs` -lm
POLICY_ALWAYS=1 ./syncviews

and scroll with the mouse-wheel on the left-side column of the list. It won't scroll, but the right one does. With the patch applied, both sides work.
Comment 2 Matthias Clasen 2014-10-05 03:41:13 UTC
Created attachment 287746 [details] [review]
GtkScrolledWindow: Allow scrolling without bars

Add a new policy, GTK_POLICY_EXTERNAL, which hides the scrollbar,
but does not force the scrolled windows size to be determined by
its child. This can be used to keep two scrolled windows in sync,
while sharing a single scrollbar.
Comment 3 Matthias Clasen 2014-10-05 03:41:27 UTC
Created attachment 287747 [details] [review]
Add an example for synchronized scrolling

This example uses GTK_POLICY_EXTERNAL to share a scrollbar among
multiple scrolled windows.
Comment 4 Matthias Clasen 2014-10-05 03:41:39 UTC
Created attachment 287748 [details] [review]
Add an experiment for overlay scrollbars

This is just meant as a prototype for how we can show a
scroll position indicator for touch. This uses GTK_POLICY_EXTERNAL
to hide the scrolled windows scrollbar while still allowing
scrolling.
Comment 5 Matthias Clasen 2014-10-05 03:47:45 UTC
How the overlay looks: https://mclasen.fedorapeople.org/overlay-scroll.webm
Comment 6 Matthias Clasen 2014-10-05 03:51:06 UTC
*** Bug 726795 has been marked as a duplicate of this bug. ***
Comment 7 Stefan Sauer (gstreamer, gtkdoc dev) 2014-10-05 15:12:45 UTC
Review of attachment 287746 [details] [review]:

Looks good, thanks.

::: gtk/gtkscrolledwindow.c
@@ +2167,3 @@
 	      else /* priv->hscrollbar_policy != GTK_POLICY_AUTOMATIC */
 		{
+		  priv->hscrollbar_visible = priv->hscrollbar_policy < GTK_POLICY_NEVER;

nit: turn into a function and/or add a comment to GtkPolicyType that the enum values must not be reordered?
Comment 8 Matthias Clasen 2014-10-10 00:19:11 UTC
Attachment 287746 [details] pushed as 94b680c - GtkScrolledWindow: Allow scrolling without bars