From d5f1754981129094afbe5d9c1d57e41599fad410 Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Mon, 14 Sep 2015 10:56:13 +0200 Subject: [PATCH] gtk: Stop setting GDK_EXPOSURE_MASK on random widgets These days exposure happens only on the native windows (generally the toplevel window) and is propagated down recursively. The expose event is only useful for backwards compat, and in fact, for double buffered widgets we totally ignore the event (and non-double buffering breaks on wayland). So, by not setting the mask we avoid emitting these events and then later ignoring them. We still keep it on eventbox, fixed and layout as these are used in weird ways that want backwards compat. --- gtk/deprecated/gtkcolorsel.c | 1 - gtk/deprecated/gtkhandlebox.c | 4 +--- gtk/deprecated/gtkmisc.c | 2 +- gtk/gtkcalendar.c | 1 - gtk/gtkflowbox.c | 1 - gtk/gtkglarea.c | 2 +- gtk/gtkiconview.c | 3 +-- gtk/gtklistbox.c | 2 +- gtk/gtkmagnifier.c | 3 +-- gtk/gtkmenu.c | 2 +- gtk/gtkmenushell.c | 3 +-- gtk/gtknotebook.c | 2 +- gtk/gtkoverlay.c | 2 +- gtk/gtkpaned.c | 2 +- gtk/gtkpopover.c | 1 - gtk/gtkrevealer.c | 2 +- gtk/gtkscrolledwindow.c | 4 ++-- gtk/gtkspinbutton.c | 2 +- gtk/gtkstack.c | 2 +- gtk/gtktextview.c | 3 +-- gtk/gtktoolitemgroup.c | 2 +- gtk/gtktoolpalette.c | 2 +- gtk/gtktreeview.c | 14 ++++++-------- gtk/gtkviewport.c | 2 +- 24 files changed, 26 insertions(+), 38 deletions(-) diff --git a/gtk/deprecated/gtkcolorsel.c b/gtk/deprecated/gtkcolorsel.c index c0d358b6d6..17fe82029e 100644 --- a/gtk/deprecated/gtkcolorsel.c +++ b/gtk/deprecated/gtkcolorsel.c @@ -1659,7 +1659,6 @@ palette_new (GtkColorSelection *colorsel) g_object_set_data (G_OBJECT (retval), I_("color_set"), GINT_TO_POINTER (0)); gtk_widget_set_events (retval, GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - | GDK_EXPOSURE_MASK | GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK); diff --git a/gtk/deprecated/gtkhandlebox.c b/gtk/deprecated/gtkhandlebox.c index 76f6e6107b..f254138763 100644 --- a/gtk/deprecated/gtkhandlebox.c +++ b/gtk/deprecated/gtkhandlebox.c @@ -494,8 +494,7 @@ gtk_handle_box_realize (GtkWidget *widget) attributes.window_type = GDK_WINDOW_CHILD; 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; window = gdk_window_new (gtk_widget_get_parent_window (widget), @@ -509,7 +508,6 @@ gtk_handle_box_realize (GtkWidget *widget) attributes.height = allocation.height; attributes.window_type = GDK_WINDOW_CHILD; attributes.event_mask = (gtk_widget_get_events (widget) - | GDK_EXPOSURE_MASK | GDK_BUTTON1_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK diff --git a/gtk/deprecated/gtkmisc.c b/gtk/deprecated/gtkmisc.c index 55eca88ba9..8ad92f09ab 100644 --- a/gtk/deprecated/gtkmisc.c +++ b/gtk/deprecated/gtkmisc.c @@ -440,7 +440,7 @@ gtk_misc_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; window = gdk_window_new (gtk_widget_get_parent_window (widget), &attributes, attributes_mask); diff --git a/gtk/gtkcalendar.c b/gtk/gtkcalendar.c index 894cd6b85a..42157c2a1e 100644 --- a/gtk/gtkcalendar.c +++ b/gtk/gtkcalendar.c @@ -1638,7 +1638,6 @@ gtk_calendar_realize (GtkWidget *widget) attributes.wclass = GDK_INPUT_ONLY; attributes.window_type = GDK_WINDOW_CHILD; attributes.event_mask = (gtk_widget_get_events (widget) - | GDK_EXPOSURE_MASK | GDK_SCROLL_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK diff --git a/gtk/gtkflowbox.c b/gtk/gtkflowbox.c index 95d54c22f6..bfd1490155 100644 --- a/gtk/gtkflowbox.c +++ b/gtk/gtkflowbox.c @@ -3086,7 +3086,6 @@ gtk_flow_box_realize (GtkWidget *widget) | GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK | GDK_POINTER_MOTION_MASK - | GDK_EXPOSURE_MASK | GDK_KEY_PRESS_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK; diff --git a/gtk/gtkglarea.c b/gtk/gtkglarea.c index f357b10098..409840974a 100644 --- a/gtk/gtkglarea.c +++ b/gtk/gtkglarea.c @@ -284,7 +284,7 @@ gtk_gl_area_realize (GtkWidget *widget) attributes.width = allocation.width; attributes.height = allocation.height; attributes.wclass = GDK_INPUT_ONLY; - 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; diff --git a/gtk/gtkiconview.c b/gtk/gtkiconview.c index f81b9096cd..4dbf096353 100644 --- a/gtk/gtkiconview.c +++ b/gtk/gtkiconview.c @@ -1300,8 +1300,7 @@ gtk_icon_view_realize (GtkWidget *widget) attributes.y = 0; attributes.width = MAX (icon_view->priv->width, allocation.width); attributes.height = MAX (icon_view->priv->height, allocation.height); - attributes.event_mask = (GDK_EXPOSURE_MASK | - GDK_SCROLL_MASK | + attributes.event_mask = (GDK_SCROLL_MASK | GDK_SMOOTH_SCROLL_MASK | GDK_POINTER_MOTION_MASK | GDK_LEAVE_NOTIFY_MASK | diff --git a/gtk/gtklistbox.c b/gtk/gtklistbox.c index bc4a1e6200..66281f813a 100644 --- a/gtk/gtklistbox.c +++ b/gtk/gtklistbox.c @@ -2094,7 +2094,7 @@ gtk_list_box_realize (GtkWidget *widget) attributes.window_type = GDK_WINDOW_CHILD; attributes.event_mask = gtk_widget_get_events (widget) | GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK | GDK_POINTER_MOTION_MASK | - GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK; + GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK; attributes.wclass = GDK_INPUT_OUTPUT; window = gdk_window_new (gtk_widget_get_parent_window (widget), diff --git a/gtk/gtkmagnifier.c b/gtk/gtkmagnifier.c index 04f15bc961..e83d3066fe 100644 --- a/gtk/gtkmagnifier.c +++ b/gtk/gtkmagnifier.c @@ -298,8 +298,7 @@ _gtk_magnifier_init (GtkMagnifier *magnifier) priv = _gtk_magnifier_get_instance_private (magnifier); gtk_widget_set_events (widget, - gtk_widget_get_events (widget) | - GDK_EXPOSURE_MASK); + gtk_widget_get_events (widget)); gtk_widget_set_has_window (widget, FALSE); priv->magnification = 1; diff --git a/gtk/gtkmenu.c b/gtk/gtkmenu.c index b39de7dd2c..61f8541950 100644 --- a/gtk/gtkmenu.c +++ b/gtk/gtkmenu.c @@ -2582,7 +2582,7 @@ gtk_menu_realize (GtkWidget *widget) attributes.wclass = GDK_INPUT_OUTPUT; attributes.visual = gtk_widget_get_visual (widget); attributes.event_mask = gtk_widget_get_events (widget); - attributes.event_mask |= (GDK_EXPOSURE_MASK | GDK_KEY_PRESS_MASK | + attributes.event_mask |= (GDK_KEY_PRESS_MASK | GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK ); attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL; diff --git a/gtk/gtkmenushell.c b/gtk/gtkmenushell.c index 80044ef3fe..a56e934bdf 100644 --- a/gtk/gtkmenushell.c +++ b/gtk/gtkmenushell.c @@ -602,8 +602,7 @@ gtk_menu_shell_realize (GtkWidget *widget) attributes.wclass = GDK_INPUT_OUTPUT; attributes.visual = gtk_widget_get_visual (widget); attributes.event_mask = gtk_widget_get_events (widget); - attributes.event_mask |= (GDK_EXPOSURE_MASK | - GDK_BUTTON_PRESS_MASK | + attributes.event_mask |= (GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK | GDK_KEY_PRESS_MASK | diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c index 0f631b9764..8048dab4ff 100644 --- a/gtk/gtknotebook.c +++ b/gtk/gtknotebook.c @@ -3116,7 +3116,7 @@ show_drag_window (GtkNotebook *notebook, attributes.window_type = GDK_WINDOW_CHILD; attributes.wclass = GDK_INPUT_OUTPUT; attributes.visual = gtk_widget_get_visual (widget); - attributes.event_mask = GDK_VISIBILITY_NOTIFY_MASK | GDK_EXPOSURE_MASK | GDK_POINTER_MOTION_MASK; + attributes.event_mask = GDK_VISIBILITY_NOTIFY_MASK | GDK_POINTER_MOTION_MASK; attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL; priv->drag_window = gdk_window_new (gtk_widget_get_parent_window (widget), diff --git a/gtk/gtkoverlay.c b/gtk/gtkoverlay.c index 1cac3225a5..661f3d10d6 100644 --- a/gtk/gtkoverlay.c +++ b/gtk/gtkoverlay.c @@ -151,7 +151,7 @@ gtk_overlay_create_child_window (GtkOverlay *overlay, attributes.y = allocation.y; attributes.visual = gtk_widget_get_visual (widget); attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL; - attributes.event_mask = gtk_widget_get_events (widget) | GDK_EXPOSURE_MASK; + attributes.event_mask = gtk_widget_get_events (widget); window = gdk_window_new (gtk_widget_get_window (widget), &attributes, attributes_mask); diff --git a/gtk/gtkpaned.c b/gtk/gtkpaned.c index e6d230c15f..f9fb9786aa 100644 --- a/gtk/gtkpaned.c +++ b/gtk/gtkpaned.c @@ -1526,7 +1526,7 @@ gtk_paned_create_child_window (GtkPaned *paned, attributes.window_type = GDK_WINDOW_CHILD; attributes.wclass = GDK_INPUT_OUTPUT; - attributes.event_mask = gtk_widget_get_events (widget) | GDK_EXPOSURE_MASK; + attributes.event_mask = gtk_widget_get_events (widget); attributes.visual = gtk_widget_get_visual (widget); if (child) { diff --git a/gtk/gtkpopover.c b/gtk/gtkpopover.c index 86eda36bf1..969717ba16 100644 --- a/gtk/gtkpopover.c +++ b/gtk/gtkpopover.c @@ -345,7 +345,6 @@ gtk_popover_realize (GtkWidget *widget) GDK_BUTTON_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | - GDK_EXPOSURE_MASK | GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK; diff --git a/gtk/gtkrevealer.c b/gtk/gtkrevealer.c index 20ff0dcc63..424840aec3 100644 --- a/gtk/gtkrevealer.c +++ b/gtk/gtkrevealer.c @@ -367,7 +367,7 @@ gtk_revealer_real_realize (GtkWidget *widget) attributes.wclass = GDK_INPUT_OUTPUT; attributes.visual = gtk_widget_get_visual (widget); attributes.event_mask = - gtk_widget_get_events (widget) | GDK_EXPOSURE_MASK; + gtk_widget_get_events (widget); attributes_mask = (GDK_WA_X | GDK_WA_Y) | GDK_WA_VISUAL; priv->view_window = diff --git a/gtk/gtkscrolledwindow.c b/gtk/gtkscrolledwindow.c index bc29e9d1bd..c97a6f2c6d 100644 --- a/gtk/gtkscrolledwindow.c +++ b/gtk/gtkscrolledwindow.c @@ -3936,7 +3936,7 @@ create_indicator_window (GtkScrolledWindow *scrolled_window, attributes.y = allocation.y; attributes.visual = gtk_widget_get_visual (widget); attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL; - attributes.event_mask = gtk_widget_get_events (widget) | GDK_EXPOSURE_MASK; + attributes.event_mask = gtk_widget_get_events (widget); window = gdk_window_new (gtk_widget_get_window (widget), &attributes, attributes_mask); @@ -4226,7 +4226,7 @@ gtk_scrolled_window_realize (GtkWidget *widget) attributes.y = allocation.y; attributes.visual = gtk_widget_get_visual (widget); attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL; - attributes.event_mask = gtk_widget_get_events (widget) | GDK_EXPOSURE_MASK | + attributes.event_mask = gtk_widget_get_events (widget) | GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK | GDK_POINTER_MOTION_MASK; window = gdk_window_new (gtk_widget_get_parent_window (widget), diff --git a/gtk/gtkspinbutton.c b/gtk/gtkspinbutton.c index 649ad5af42..bac8bdeb23 100644 --- a/gtk/gtkspinbutton.c +++ b/gtk/gtkspinbutton.c @@ -1093,7 +1093,7 @@ gtk_spin_button_realize (GtkWidget *widget) attributes.wclass = GDK_INPUT_ONLY; attributes.visual = gtk_widget_get_visual (widget); attributes.event_mask = gtk_widget_get_events (widget); - attributes.event_mask |= GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK + attributes.event_mask |= GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_LEAVE_NOTIFY_MASK | GDK_ENTER_NOTIFY_MASK | GDK_POINTER_MOTION_MASK; diff --git a/gtk/gtkstack.c b/gtk/gtkstack.c index 7764af3a8e..a769abd8eb 100644 --- a/gtk/gtkstack.c +++ b/gtk/gtkstack.c @@ -343,7 +343,7 @@ gtk_stack_realize (GtkWidget *widget) attributes.wclass = GDK_INPUT_OUTPUT; attributes.visual = gtk_widget_get_visual (widget); attributes.event_mask = - gtk_widget_get_events (widget) | GDK_EXPOSURE_MASK; + gtk_widget_get_events (widget); attributes_mask = (GDK_WA_X | GDK_WA_Y) | GDK_WA_VISUAL; priv->view_window = diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c index 697d63f53e..e9860d79e4 100644 --- a/gtk/gtktextview.c +++ b/gtk/gtktextview.c @@ -4602,7 +4602,7 @@ gtk_text_view_realize (GtkWidget *widget) attributes.height = allocation.height; attributes.wclass = GDK_INPUT_OUTPUT; attributes.visual = gtk_widget_get_visual (widget); - attributes.event_mask = GDK_VISIBILITY_NOTIFY_MASK | GDK_EXPOSURE_MASK; + attributes.event_mask = GDK_VISIBILITY_NOTIFY_MASK; attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL; @@ -9814,7 +9814,6 @@ text_window_realize (GtkTextWindow *win, attributes.width = win->allocation.width; attributes.height = win->allocation.height; attributes.event_mask = gtk_widget_get_events (win->widget) - | GDK_EXPOSURE_MASK | GDK_SCROLL_MASK | GDK_SMOOTH_SCROLL_MASK | GDK_KEY_PRESS_MASK diff --git a/gtk/gtktoolitemgroup.c b/gtk/gtktoolitemgroup.c index 785785d641..719ccff23d 100644 --- a/gtk/gtktoolitemgroup.c +++ b/gtk/gtktoolitemgroup.c @@ -1229,7 +1229,7 @@ gtk_tool_item_group_realize (GtkWidget *widget) attributes.wclass = GDK_INPUT_OUTPUT; attributes.visual = gtk_widget_get_visual (widget); attributes.event_mask = gtk_widget_get_events (widget) - | GDK_VISIBILITY_NOTIFY_MASK | GDK_EXPOSURE_MASK + | GDK_VISIBILITY_NOTIFY_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_BUTTON_MOTION_MASK; attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL; diff --git a/gtk/gtktoolpalette.c b/gtk/gtktoolpalette.c index 70ca79f9c4..82e76375da 100644 --- a/gtk/gtktoolpalette.c +++ b/gtk/gtktoolpalette.c @@ -728,7 +728,7 @@ gtk_tool_palette_realize (GtkWidget *widget) attributes.wclass = GDK_INPUT_OUTPUT; attributes.visual = gtk_widget_get_visual (widget); attributes.event_mask = gtk_widget_get_events (widget) - | GDK_VISIBILITY_NOTIFY_MASK | GDK_EXPOSURE_MASK + | GDK_VISIBILITY_NOTIFY_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_BUTTON_MOTION_MASK | GDK_SCROLL_MASK | GDK_SMOOTH_SCROLL_MASK diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c index 852bc3c46f..3eec8e4ae4 100644 --- a/gtk/gtktreeview.c +++ b/gtk/gtktreeview.c @@ -2412,8 +2412,7 @@ gtk_tree_view_realize (GtkWidget *widget) attributes.y = gtk_tree_view_get_effective_header_height (tree_view); attributes.width = MAX (tree_view->priv->width, allocation.width); attributes.height = allocation.height; - attributes.event_mask = (GDK_EXPOSURE_MASK | - GDK_SCROLL_MASK | + attributes.event_mask = (GDK_SCROLL_MASK | GDK_SMOOTH_SCROLL_MASK | GDK_POINTER_MOTION_MASK | GDK_ENTER_NOTIFY_MASK | @@ -2435,8 +2434,7 @@ gtk_tree_view_realize (GtkWidget *widget) attributes.y = 0; attributes.width = MAX (tree_view->priv->width, allocation.width); attributes.height = tree_view->priv->header_height; - attributes.event_mask = (GDK_EXPOSURE_MASK | - GDK_SCROLL_MASK | + attributes.event_mask = (GDK_SCROLL_MASK | GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK | GDK_BUTTON_PRESS_MASK | @@ -3951,7 +3949,7 @@ gtk_tree_view_motion_draw_column_motion_arrow (GtkTreeView *tree_view) width = attributes.width = drag_allocation.width; height = attributes.height = drag_allocation.height; attributes.visual = gdk_screen_get_rgba_visual (gtk_widget_get_screen (widget)); - attributes.event_mask = GDK_VISIBILITY_NOTIFY_MASK | GDK_EXPOSURE_MASK | GDK_POINTER_MOTION_MASK; + attributes.event_mask = GDK_VISIBILITY_NOTIFY_MASK | GDK_POINTER_MOTION_MASK; attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL; tree_view->priv->drag_highlight_window = gdk_window_new (tree_view->priv->header_window, &attributes, attributes_mask); gtk_widget_register_window (GTK_WIDGET (tree_view), tree_view->priv->drag_highlight_window); @@ -3997,7 +3995,7 @@ gtk_tree_view_motion_draw_column_motion_arrow (GtkTreeView *tree_view) attributes.window_type = GDK_WINDOW_TEMP; attributes.wclass = GDK_INPUT_OUTPUT; attributes.visual = gtk_widget_get_visual (GTK_WIDGET (tree_view)); - attributes.event_mask = GDK_VISIBILITY_NOTIFY_MASK | GDK_EXPOSURE_MASK | GDK_POINTER_MOTION_MASK; + attributes.event_mask = GDK_VISIBILITY_NOTIFY_MASK | GDK_POINTER_MOTION_MASK; attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL; attributes.x = x; attributes.y = y; @@ -4078,7 +4076,7 @@ gtk_tree_view_motion_draw_column_motion_arrow (GtkTreeView *tree_view) attributes.window_type = GDK_WINDOW_TEMP; attributes.wclass = GDK_INPUT_OUTPUT; attributes.visual = gtk_widget_get_visual (GTK_WIDGET (tree_view)); - attributes.event_mask = GDK_VISIBILITY_NOTIFY_MASK | GDK_EXPOSURE_MASK | GDK_POINTER_MOTION_MASK; + attributes.event_mask = GDK_VISIBILITY_NOTIFY_MASK | GDK_POINTER_MOTION_MASK; attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL; attributes.x = x; attributes.y = y; @@ -10041,7 +10039,7 @@ _gtk_tree_view_column_start_drag (GtkTreeView *tree_view, attributes.width = button_allocation.width; attributes.height = button_allocation.height; attributes.visual = gtk_widget_get_visual (GTK_WIDGET (tree_view)); - attributes.event_mask = GDK_VISIBILITY_NOTIFY_MASK | GDK_EXPOSURE_MASK | GDK_POINTER_MOTION_MASK; + attributes.event_mask = GDK_VISIBILITY_NOTIFY_MASK | GDK_POINTER_MOTION_MASK; attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL; tree_view->priv->drag_window = gdk_window_new (tree_view->priv->header_window, diff --git a/gtk/gtkviewport.c b/gtk/gtkviewport.c index 9b966052a6..f885292b15 100644 --- a/gtk/gtkviewport.c +++ b/gtk/gtkviewport.c @@ -747,7 +747,7 @@ gtk_viewport_realize (GtkWidget *widget) attributes.wclass = GDK_INPUT_OUTPUT; attributes.visual = gtk_widget_get_visual (widget); - event_mask = gtk_widget_get_events (widget) | GDK_EXPOSURE_MASK; + event_mask = gtk_widget_get_events (widget); attributes.event_mask = event_mask | GDK_SCROLL_MASK | GDK_TOUCH_MASK | GDK_SMOOTH_SCROLL_MASK;