From fb08738be8ecb8af6008b713a0fbe0770954148e Mon Sep 17 00:00:00 2001 From: monsta Date: Wed, 25 Oct 2017 16:37:48 +0300 Subject: baobab: make zoom with mousewheel work on chart like it was with GTK+2 ported from: https://git.gnome.org/browse/baobab/commit/?id=66ad37228e155fe6707064109eae2dd17cc1e969 https://git.gnome.org/browse/baobab/commit/?id=d724a028d54fea765dda4578a1f30910e77ab1a9 --- baobab/src/baobab-chart.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'baobab/src') diff --git a/baobab/src/baobab-chart.c b/baobab/src/baobab-chart.c index d981c773..7848bdef 100644 --- a/baobab/src/baobab-chart.c +++ b/baobab/src/baobab-chart.c @@ -320,7 +320,7 @@ baobab_chart_realize (GtkWidget *widget) attributes.height = allocation.height; attributes.wclass = GDK_INPUT_OUTPUT; attributes.visual = gtk_widget_get_visual (widget); - attributes.event_mask = gtk_widget_get_events (widget) | GDK_EXPOSURE_MASK; + attributes.event_mask = gtk_widget_get_events (widget); attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL; @@ -336,7 +336,8 @@ baobab_chart_realize (GtkWidget *widget) gtk_widget_add_events (widget, GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK | - GDK_POINTER_MOTION_HINT_MASK | GDK_LEAVE_NOTIFY_MASK); + GDK_POINTER_MOTION_HINT_MASK | GDK_LEAVE_NOTIFY_MASK | + GDK_SCROLL_MASK); } static void @@ -969,6 +970,12 @@ baobab_chart_scroll (GtkWidget *widget, if (baobab_chart_can_zoom_in (widget)) baobab_chart_zoom_in (widget); break; + + case GDK_SCROLL_SMOOTH : + /* since we don't add GDK_SMOOTH_SCROLL_MASK to received + events, this is actually never reached and it's here + just to silence compiler warnings */ + break; } return FALSE; -- cgit v1.2.1