]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Make scroll events work again in GTK3.
authorSimon Tatham <anakin@pobox.com>
Fri, 25 Sep 2015 13:09:57 +0000 (14:09 +0100)
committerSimon Tatham <anakin@pobox.com>
Fri, 25 Sep 2015 13:14:05 +0000 (14:14 +0100)
Apparently, if you don't specify GDK_SMOOTH_SCROLL_MASK in a widget's
event mask, then you don't receive "scroll_event" signals at all, even
of the non-smooth variety that was all GTK2 had. Hence, neither mouse
scroll wheels nor touchpad scroll gestures seem to generate any
response.

Adding GDK_SMOOTH_SCROLL_MASK brings the old scroll events back again,
so this is at least no worse than GTK2 was. But in GTK3 we _ought_ to
be able to do better still, by supporting smooth scrolling from
touchpads; this commit doesn't do that.

unix/gtkwin.c

index 67db44aec9109219d00a944cceaf4d9d0d0d9f19..53f01fbbe34df4bf1fd2d31faf5a9c0eb10ebbeb 100644 (file)
@@ -4933,7 +4933,11 @@ int pt_main(int argc, char **argv)
     gtk_widget_add_events(GTK_WIDGET(inst->area),
                          GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK |
                          GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
-                         GDK_POINTER_MOTION_MASK | GDK_BUTTON_MOTION_MASK);
+                         GDK_POINTER_MOTION_MASK | GDK_BUTTON_MOTION_MASK
+#if GTK_CHECK_VERSION(3,4,0)
+                          | GDK_SMOOTH_SCROLL_MASK
+#endif
+        );
 
     {
        extern const char *const *const main_icon[];