[gtk+] stack: Ensure the bin window has an evmask suitable to windowless children



commit 8ff47570af18c42800c629e6c0ec6e98f2302f18
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon Aug 11 16:49:46 2014 +0200

    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 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkstack.c b/gtk/gtkstack.c
index a0c38bb..144724e 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);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]