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 558659 - In mousewheel event, do horizontal scroll when no vertical scroll is available in a gtkscrolledwindow
In mousewheel event, do horizontal scroll when no vertical scroll is availabl...
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: Widget: GtkScrolledWindow
unspecified
Other All
: Normal enhancement
: ---
Assigned To: gtk-bugs
gtk-bugs
scrolling
: 550095 555571 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2008-10-31 13:10 UTC by Nelson Benitez
Modified: 2018-05-02 14:36 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch for this issue (566 bytes, patch)
2008-10-31 13:57 UTC, Nelson Benitez
none Details | Review
New patch (556 bytes, patch)
2008-11-03 13:49 UTC, Nelson Benitez
none Details | Review
[PATCH] Bug 558659 – In mousewheel event, do horizontal scroll when no vertical scroll is available in a gtkscrolledwindow (1.39 KB, patch)
2008-11-03 18:28 UTC, Christian Persch
none Details | Review

Description Nelson Benitez 2008-10-31 13:10:02 UTC
Hi!, nautilus has recently added a "compact view" that is like traditional icon view but it has no vertical scrollbar, instead the icons are spread horizontally so the horizontal scrollbar is in most cases present. We have a request in nautilus (bug 555571) that the compact view could be scrolled horizontally with the mouse wheel, this is a common sense behaviour because there's no vertical scroll available, so the mousewheel should do a horizontal scroll instead.

As nautilus uses GtkScrolledWindow for the compact view, I'm attaching a patch here, and also because imho this behaviour should be default in any GtkScrolledWindow, that is, make the mouse wheel do horizontal scroll when no vertical scroll is available.
Comment 1 Nelson Benitez 2008-10-31 13:57:20 UTC
Created attachment 121726 [details] [review]
Patch for this issue

With this patch nautilus compact view does horizontal scroll with the mouse wheel, I also tried the EOG image collection[1] and does horizontal scrolling with the mouse wheel...

[1] In EOG menu, View->Image Collection to show it.
Comment 2 Christian Dywan 2008-10-31 19:36:41 UTC
Comment on attachment 121726 [details] [review]
Patch for this issue

>Index: gtk/gtkscrolledwindow.c
>===================================================================
>--- gtk/gtkscrolledwindow.c	(revision 21651)
>+++ gtk/gtkscrolledwindow.c	(working copy)
>@@ -1504,6 +1504,9 @@ gtk_scrolled_window_scroll_event (GtkWid
> 
>   if (event->direction == GDK_SCROLL_UP || event->direction == GDK_SCROLL_DOWN)
>     range = GTK_SCROLLED_WINDOW (widget)->vscrollbar;
>+    if (!range || !GTK_WIDGET_VISIBLE (range)) {
>+    	range = GTK_SCROLLED_WINDOW (widget)->hscrollbar;
>+    }
>   else
>     range = GTK_SCROLLED_WINDOW (widget)->hscrollbar;

The "(!range)" part is wrong.

Other than that I think this seems like intuitive behaviour.
Comment 3 Nelson Benitez 2008-11-01 12:57:08 UTC
Ok, I'll check on monday and resend the patch..
Comment 4 Nelson Benitez 2008-11-03 13:49:35 UTC
Created attachment 121864 [details] [review]
New patch

Ok, after testing it seems you are right so here is a new patch attached :)..
Comment 5 Nelson Benitez 2008-11-03 13:54:39 UTC
*** Bug 555571 has been marked as a duplicate of this bug. ***
Comment 6 Christian Persch 2008-11-03 18:23:34 UTC
   if (event->direction == GDK_SCROLL_UP || event->direction == GDK_SCROLL_DOWN)
     range = GTK_SCROLLED_WINDOW (widget)->vscrollbar;
+    if (!GTK_WIDGET_VISIBLE (range)) {
+    	range = GTK_SCROLLED_WINDOW (widget)->hscrollbar;
+    }
   else

This is obviously incorrect (missing braces).

Also, why not do this symmetrically, i.e. with horiz scroll on scrolled window with invisible horiz scrollbar, scroll vertically?
Comment 7 Christian Persch 2008-11-03 18:28:18 UTC
Created attachment 121891 [details] [review]
[PATCH] Bug 558659 – In mousewheel event, do horizontal scroll when no vertical scroll is available in a gtkscrolledwindow

Bug 132197 – Horizontal Scrolling Using Modifier Key and Scroll Wheel
---
 gtk/gtkscrolledwindow.c |   20 +++++++++++++-------
 1 files changed, 13 insertions(+), 7 deletions(-)
Comment 8 Nelson Benitez 2008-11-04 09:07:20 UTC
(In reply to comment #7)
> Created an attachment (id=121891) [edit]
> [PATCH] Bug 558659 – In mousewheel event, do horizontal scroll when no
> vertical scroll is available in a gtkscrolledwindow
> 
> Bug 132197 – Horizontal Scrolling Using Modifier Key and Scroll Wheel
> ---

 I've tested your patch and I like it very much, it fills both bug requirements with good defaults, thank you!
Comment 9 Wouter Bolsterlee (uws) 2008-11-05 13:16:52 UTC
Having this functionality would certainly help users navigate around in scrolled windows. Think of the Rule of Least Surprise: if there is a scrollbar, the scrollwheel should work (that's the whole point of having a scroll wheel, right?), be it horizontally or vertically. This patch does just that.
Comment 10 Nelson Benitez 2008-11-17 13:00:35 UTC
*ping*

Do we need to post to gtk list or ping someone to get this commited?
Comment 11 John Boncek 2008-11-19 16:16:45 UTC
-1.  In my opinion, this is counter-intuitive and feature bloat.
Comment 12 Yevgen Muntyan 2008-11-20 07:37:21 UTC
Thunderbird implements this in the mail list (at least on mac) and it sucks when you use a trackpad to scroll - you got to scroll down and right, otherwise scrolling left gets interpreted as scrolling up, so if you move fingers down and left (there is no horizontal scrollbar, so you just move fingers "down", without much trying to make it vertical only) then you get fancy effects of scrollbar jumping back and forth.
Scrolling in random directions when content changes is also no fun (web browser, different pages, sometimes you have scrollbar(s), sometimes you don't, depending on the page).
Interesting stories aside, it should be up to application. There is one application (or rather one type of widgets) where it's needed - file browser. Why change (i.e. break) everything for that one use case?
Comment 13 B Smith 2009-02-06 02:52:22 UTC
I don't have any opinion re how other apps should work, but please fix this in Nautilus and Compact View.  I'm running Gnome 2.24 (Ubuntu 8.10) and this omission trips me up daily.
Comment 14 Nelson Benitez 2009-02-27 13:12:40 UTC
Taking in consideration the issues brought by comment 12, we could add a property to gtkscrolledwindow to activate this feature, it would be disable by default, and nautilus could enable it with eg. gtk_scrolled_window_set_orthogonal_scroll(window , TRUE);

what do maintainers think, could this be included that way?
Comment 15 Wouter Bolsterlee (uws) 2009-02-27 13:28:25 UTC
Fwiw, Nautilus has been changed to do this already, see Bug 571770 – Horizontal scroll on mouse wheel event.
Comment 16 Nelson Benitez 2009-02-27 13:39:00 UTC
(In reply to comment #15)
> Fwiw, Nautilus has been changed to do this already, see Bug 571770 –
> Horizontal scroll on mouse wheel event.
> 

Oh, fine! , I wasn't aware of that bug, thank you.
Comment 17 William Jon McCann 2013-03-26 16:57:43 UTC
*** Bug 550095 has been marked as a duplicate of this bug. ***
Comment 18 Daniel Boles 2017-08-15 14:22:03 UTC
(In reply to John Boncek from comment #11)
> -1.  In my opinion, this is counter-intuitive and feature bloat.

I agree.

This is obsolete as Nautilus doesn't have a compact view anymore, and I don't like it as an idea for general use in GTK+.

That said, it's not up to me, so let's see if any maintainer agrees...
Comment 19 GNOME Infrastructure Team 2018-05-02 14:36:58 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gtk/issues/304.