summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCosimo Cecchi <cosimoc@gnome.org>2012-03-08 10:06:38 -0500
committerCosimo Cecchi <cosimoc@gnome.org>2012-03-08 10:06:38 -0500
commit1a76e044a2c9b834d00c4ea30f1e3af3321d8cdd (patch)
tree226d6332a9c44ff977eff26982eecaaf12300fcc
parent0d46b0620b3b120cde310cb2319c309d8f3e3b82 (diff)
downloadnautilus-1a76e044a2c9b834d00c4ea30f1e3af3321d8cdd.tar.gz
view: handle smooth scroll events for zooming
Instead of reaching the g_assert_not_reached() and crash. https://bugzilla.gnome.org/show_bug.cgi?id=671650
-rw-r--r--src/nautilus-view.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/nautilus-view.c b/src/nautilus-view.c
index 1be5be93d..ed0c78cb5 100644
--- a/src/nautilus-view.c
+++ b/src/nautilus-view.c
@@ -9465,6 +9465,8 @@ gboolean
nautilus_view_handle_scroll_event (NautilusView *directory_view,
GdkEventScroll *event)
{
+ gdouble delta_x, delta_y;
+
if (event->state & GDK_CONTROL_MASK) {
switch (event->direction) {
case GDK_SCROLL_UP:
@@ -9477,6 +9479,20 @@ nautilus_view_handle_scroll_event (NautilusView *directory_view,
nautilus_view_bump_zoom_level (directory_view, -1);
return TRUE;
+ case GDK_SCROLL_SMOOTH:
+ gdk_event_get_scroll_deltas ((const GdkEvent *) event,
+ &delta_x, &delta_y);
+
+ if (delta_y > 0) {
+ nautilus_view_bump_zoom_level (directory_view, 1);
+ return TRUE;
+ } else if (delta_y < 0) {
+ nautilus_view_bump_zoom_level (directory_view, -1);
+ return TRUE;
+ } else {
+ break;
+ }
+
case GDK_SCROLL_LEFT:
case GDK_SCROLL_RIGHT:
break;