From ae053dbf2cc26ae74df5e782261c3a3bc7126763 Mon Sep 17 00:00:00 2001 From: lukefromdc Date: Fri, 4 Nov 2016 14:15:47 -0400 Subject: Compact view: ensure horizontal mouse wheel works both directions Apply patch by ZenWalker for horizontal scrollwheel mice, without it scrolling left or right scrolls right only --- src/file-manager/fm-icon-view.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/file-manager/fm-icon-view.c b/src/file-manager/fm-icon-view.c index fe6148e2..d5980511 100644 --- a/src/file-manager/fm-icon-view.c +++ b/src/file-manager/fm-icon-view.c @@ -2507,16 +2507,15 @@ fm_icon_view_scroll_event (GtkWidget *widget, scroll_event_copy = (GdkEventScroll *) event_copy; - /* transform vertical integer smooth scroll events into horizontal events */ - if (scroll_event_copy->direction == GDK_SCROLL_SMOOTH && - scroll_event_copy->delta_x == 0) { - if (scroll_event_copy->delta_y == 1.0) { - scroll_event_copy->direction = GDK_SCROLL_DOWN; - } else if (scroll_event_copy->delta_y == -1.0) { - scroll_event_copy->direction = GDK_SCROLL_UP; - } - } - if (scroll_event_copy->direction == GDK_SCROLL_UP) + /* transform vertical integer smooth scroll events into horizontal events */ + if (scroll_event_copy->direction == GDK_SCROLL_SMOOTH && scroll_event_copy->delta_x == 0) { + if (scroll_event_copy->delta_y == 1.0) { + scroll_event_copy->direction = GDK_SCROLL_DOWN; + } else if (scroll_event_copy->delta_y == -1.0) { + scroll_event_copy->direction = GDK_SCROLL_UP; + } + } + if ((scroll_event_copy->direction == GDK_SCROLL_UP) || (scroll_event_copy->delta_x == -1.0)) { scroll_event_copy->direction = GDK_SCROLL_LEFT; } -- cgit v1.2.1