RESOLVED FIXED 29348
[Gtk] Scrollwheel on horizontal scrollbars should slide horizontally
https://bugs.webkit.org/show_bug.cgi?id=29348
Summary [Gtk] Scrollwheel on horizontal scrollbars should slide horizontally
Reinout van Schouwen
Reported Thursday, September 17, 2009 10:51:27 PM UTC
Prompted by https://bugzilla.gnome.org/show_bug.cgi?id=595493 filed against the Gecko backend, but valid for Webkit as well. The Gtk scrollbar behaviour should be followed so that using the scroll wheel on horizontal scrollbars slides horizontally, instead of vertically.
Attachments
proposed fix (15.44 KB, patch)
2009-09-18 06:15 PDT, Gustavo Noronha (kov)
gustavo: commit-queue-
proposed fix (16.39 KB, patch)
2009-09-20 18:18 PDT, Gustavo Noronha (kov)
gustavo: commit-queue-
patch using proper signal emission technique (16.36 KB, patch)
2009-09-23 14:13 PDT, Gustavo Noronha (kov)
oliver: review-
gustavo: commit-queue-
losing deltaX in favor of deltaY, this time (16.36 KB, patch)
2009-09-23 17:31 PDT, Gustavo Noronha (kov)
oliver: review+
gustavo: commit-queue-
Gustavo Noronha (kov)
Comment 1 Thursday, September 17, 2009 10:55:14 PM UTC
Notice that the wrong behavior only happens with scrollbars created by webcore - if you try scrolling like that with scrollbars handled by GtkScrolledWindow (which you get by making the browser window too small on this bug report, for example) it will work.
Gustavo Noronha (kov)
Comment 2 Friday, September 18, 2009 2:15:10 PM UTC
Created attachment 39757 [details] proposed fix
Gustavo Noronha (kov)
Comment 3 Monday, September 21, 2009 2:18:46 AM UTC
Created attachment 39838 [details] proposed fix Patch updated addressing suggestion by olliej - avoiding an #if PLATFORM inside the handler itself, calling a method that can be overriden by the platform instead.
Xan Lopez
Comment 4 Monday, September 21, 2009 8:18:48 PM UTC
(In reply to comment #3) > Created an attachment (id=39838) [details] > proposed fix > > Patch updated addressing suggestion by olliej - avoiding an #if PLATFORM inside > the handler itself, calling a method that can be overriden by the platform > instead. Just a small comment, as mentioned in bug #29203 we should be at least using gtk_widget_event here, which at least emits all the signals needed to correctly create events.
Gustavo Noronha (kov)
Comment 5 Wednesday, September 23, 2009 10:13:20 PM UTC
Created attachment 40017 [details] patch using proper signal emission technique
Oliver Hunt
Comment 6 Wednesday, September 23, 2009 11:48:08 PM UTC
Comment on attachment 40017 [details] patch using proper signal emission technique > + void turnVerticalTicksIntoHorizontal() > + { > + m_deltaX += m_deltaY; > + m_deltaY = 0; > + > + m_wheelTicksX += m_wheelTicksY; > + m_wheelTicksY = 0; > + } I'm unhappy with this function, either it is dropping deltax entirely -- m_deltaX = m_deltaY -- or it is rotating the orientation 90 degrees, in which case x and y delta, etc should be swapped.
Gustavo Noronha (kov)
Comment 7 Thursday, September 24, 2009 12:08:08 AM UTC
(In reply to comment #6) > (From update of attachment 40017 [details]) > > > + void turnVerticalTicksIntoHorizontal() > > + { > > + m_deltaX += m_deltaY; > > + m_deltaY = 0; > > + > > + m_wheelTicksX += m_wheelTicksY; > > + m_wheelTicksY = 0; > > + } > > I'm unhappy with this function, either it is dropping deltax entirely -- > m_deltaX = m_deltaY -- or it is rotating the orientation 90 degrees, in which > case x and y delta, etc should be swapped. I can do any of those, but that will not match what GTK+ does (GTK+ does sum the y ticks into the x ones in my tests), so we need to customize it somehow. What do you suggest in this case? Drop deltax for the default implementation, and make a GTK+-specific implementation that behaves like GTK+?
Gustavo Noronha (kov)
Comment 8 Thursday, September 24, 2009 1:31:02 AM UTC
Created attachment 40032 [details] losing deltaX in favor of deltaY, this time
Gustavo Noronha (kov)
Comment 9 Thursday, September 24, 2009 1:31:35 AM UTC
(In reply to comment #8) > Created an attachment (id=40032) [details] > losing deltaX in favor of deltaY, this time As I commented on IRC: I did not find the code that handles this, but changing the code to lose deltaX doesn't really change my feel - GTK+ isn't really able to represent both directions in the same event, tbh, so maybe the point is moot after all.
Oliver Hunt
Comment 10 Thursday, September 24, 2009 10:10:33 PM UTC
Comment on attachment 40032 [details] losing deltaX in favor of deltaY, this time r=me
Gustavo Noronha (kov)
Comment 11 Thursday, September 24, 2009 10:59:53 PM UTC
Landed as r48735, thanks!
Note You need to log in before you can comment on or make changes to this bug.