[gtk+/wip/baedert/gtkimageview: 165/185] GtkImageView: Ignore zoom-scroll when ctrl/shift are pressed



commit 9d8baf758841ce3fcea8cc821b69663b24e6399b
Author: Timm Bäder <mail baedert org>
Date:   Wed Jan 27 18:48:53 2016 +0100

    GtkImageView: Ignore zoom-scroll when ctrl/shift are pressed

 gtk/gtkimageview.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkimageview.c b/gtk/gtkimageview.c
index 01ea2c8..39c3fb2 100644
--- a/gtk/gtkimageview.c
+++ b/gtk/gtkimageview.c
@@ -1470,7 +1470,8 @@ gtk_image_view_realize (GtkWidget *widget)
                           GDK_BUTTON_PRESS_MASK |
                           GDK_BUTTON_RELEASE_MASK |
                           GDK_SMOOTH_SCROLL_MASK |
-                          GDK_SCROLL_MASK;
+                          GDK_SCROLL_MASK |
+                          GDK_TOUCH_MASK;
   attributes.wclass = GDK_INPUT_ONLY;
 
   window = gtk_widget_get_parent_window (widget);
@@ -1624,6 +1625,11 @@ gtk_image_view_scroll_event (GtkWidget       *widget,
   if (!priv->image_surface)
     return GDK_EVENT_PROPAGATE;
 
+  if (event->state & GDK_SHIFT_MASK ||
+      event->state & GDK_CONTROL_MASK)
+    return GDK_EVENT_PROPAGATE;
+
+
   gtk_image_view_get_current_state (image_view, &state);
 
   gtk_image_view_set_scale_internal (image_view, new_scale);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]