From 8ff47570af18c42800c629e6c0ec6e98f2302f18 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Mon, 11 Aug 2014 16:49:46 +0200 Subject: [PATCH] stack: Ensure the bin window has an evmask suitable to windowless children If a child has set_has_window == FALSE, it purely relies on the events set on the parent window, for which the bin window used to just ensure the exposure mask, eating all input events. https://bugzilla.gnome.org/show_bug.cgi?id=734357 --- gtk/gtkstack.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/gtk/gtkstack.c b/gtk/gtkstack.c index a0c38bbb2b..144724e4cc 100644 --- a/gtk/gtkstack.c +++ b/gtk/gtkstack.c @@ -318,6 +318,12 @@ gtk_stack_realize (GtkWidget *widget) attributes.width = allocation.width; attributes.height = allocation.height; + for (l = priv->children; l != NULL; l = l->next) + { + info = l->data; + attributes.event_mask |= gtk_widget_get_events (info->widget); + } + priv->bin_window = gdk_window_new (priv->view_window, &attributes, attributes_mask); gtk_widget_register_window (widget, priv->bin_window); @@ -1133,6 +1139,11 @@ gtk_stack_add (GtkContainer *container, gtk_widget_set_parent_window (child, priv->bin_window); gtk_widget_set_parent (child, GTK_WIDGET (stack)); + if (priv->bin_window) + gdk_window_set_events (priv->bin_window, + gdk_window_get_events (priv->bin_window) | + gtk_widget_get_events (child)); + g_signal_connect (child, "notify::visible", G_CALLBACK (stack_child_visibility_notify_cb), stack);