summaryrefslogtreecommitdiff
path: root/gtk/gtkviewport.c
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>1999-01-28 00:57:18 +0000
committerOwen Taylor <otaylor@src.gnome.org>1999-01-28 00:57:18 +0000
commit9e5e63f0a147d0089e27c6b6af2bde70db77430c (patch)
tree8e65adde429ea8336c26a4b0cfe556fc193e9b40 /gtk/gtkviewport.c
parent7934cf9aeaac0850523edecc69a6e3427df64095 (diff)
downloadgtk+-9e5e63f0a147d0089e27c6b6af2bde70db77430c.tar.gz
Hack scrollwheel support into the eventloop, by treating button 4-5
Wed Jan 27 18:40:50 1999 Owen Taylor <otaylor@redhat.com> * gtk/gtkmain.c (gtk_main_do_event): Hack scrollwheel support into the eventloop, by treating button 4-5 presses on scrolled windows and scrollbars specially. Put it here to keep the ugliness small and confined. (We need to intercept the normal propagation in any case to have this work reliably right now, since some subwidgets will trap the button presses) * gtk/gtkviewport.c (gtk_viewport_realize): Select for BUTTON_PRESS to support the above hack.
Diffstat (limited to 'gtk/gtkviewport.c')
-rw-r--r--gtk/gtkviewport.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gtk/gtkviewport.c b/gtk/gtkviewport.c
index 168ff0317d..6964206fe1 100644
--- a/gtk/gtkviewport.c
+++ b/gtk/gtkviewport.c
@@ -430,7 +430,9 @@ gtk_viewport_realize (GtkWidget *widget)
attributes.colormap = gtk_widget_get_colormap (widget);
event_mask = gtk_widget_get_events (widget) | GDK_EXPOSURE_MASK;
- attributes.event_mask = event_mask;
+ /* We select on button_press_mask so that button 4-5 scrolls are trapped.
+ */
+ attributes.event_mask = event_mask | GDK_BUTTON_PRESS_MASK;
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;