From 0f759e4e8589c69ab3e275046bef6fffb93a470b Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Fri, 25 Sep 2015 14:09:57 +0100 Subject: [PATCH] Make scroll events work again in GTK3. 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 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/unix/gtkwin.c b/unix/gtkwin.c index 67db44ae..53f01fbb 100644 --- a/unix/gtkwin.c +++ b/unix/gtkwin.c @@ -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[];