diff options
author | lukefromdc <[email protected]> | 2016-11-03 23:31:30 -0400 |
---|---|---|
committer | lukefromdc <[email protected]> | 2016-11-04 14:56:08 -0400 |
commit | f34590dd7a71251515b90cd9812878b7d26d30b6 (patch) | |
tree | c8c87aee603a4a54e77c2ef07d7f66fa82012978 /src/file-manager/fm-icon-view.c | |
parent | 1ca6c5f9c7ced0f906de5dda119cdd37c76d8cfa (diff) | |
download | caja-f34590dd7a71251515b90cd9812878b7d26d30b6.tar.bz2 caja-f34590dd7a71251515b90cd9812878b7d26d30b6.tar.xz |
Fix mousewheel scrolling in compact view
Apply Nautilus commit https://github.com/GNOME/nautilus/commit/0832acdb4371fc7de957303e220e899c8fdcdf5c
Diffstat (limited to 'src/file-manager/fm-icon-view.c')
-rw-r--r-- | src/file-manager/fm-icon-view.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/file-manager/fm-icon-view.c b/src/file-manager/fm-icon-view.c index 933f9869..fe6148e2 100644 --- a/src/file-manager/fm-icon-view.c +++ b/src/file-manager/fm-icon-view.c @@ -2495,9 +2495,9 @@ fm_icon_view_scroll_event (GtkWidget *widget, icon_view = FM_ICON_VIEW (widget); if (icon_view->details->compact && - (scroll_event->direction == GDK_SCROLL_UP || - scroll_event->direction == GDK_SCROLL_DOWN)) - { + (scroll_event->direction == GDK_SCROLL_UP || + scroll_event->direction == GDK_SCROLL_DOWN || + scroll_event->direction == GDK_SCROLL_SMOOTH)) { ret = fm_directory_view_handle_scroll_event (FM_DIRECTORY_VIEW (icon_view), scroll_event); if (!ret) { @@ -2506,6 +2506,16 @@ fm_icon_view_scroll_event (GtkWidget *widget, event_copy = gdk_event_copy ((GdkEvent *) scroll_event); 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) { scroll_event_copy->direction = GDK_SCROLL_LEFT; |