Commit e9e878d1 authored by Matthias Clasen's avatar Matthias Clasen Committed by Matthias Clasen

Try harder to set the event masks of descendent windows. (#169821, Tommi

2005-05-18  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkwidget.c (gtk_widget_add_events): Try harder to set
	the event masks of descendent windows.  (#169821, Tommi Komulainen)
parent 763452a1
2005-05-18 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkwidget.c (gtk_widget_add_events): Try harder to set
the event masks of descendent windows. (#169821, Tommi Komulainen)
* gtk/gtktreeview.c (gtk_tree_view_get_drop_column)
(gtk_tree_view_set_column_drag_info): Fix some errors in the
handling of drop columns. (#143355, John Finlay)
......
2005-05-18 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkwidget.c (gtk_widget_add_events): Try harder to set
the event masks of descendent windows. (#169821, Tommi Komulainen)
* gtk/gtktreeview.c (gtk_tree_view_get_drop_column)
(gtk_tree_view_set_column_drag_info): Fix some errors in the
handling of drop columns. (#143355, John Finlay)
......
2005-05-18 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkwidget.c (gtk_widget_add_events): Try harder to set
the event masks of descendent windows. (#169821, Tommi Komulainen)
* gtk/gtktreeview.c (gtk_tree_view_get_drop_column)
(gtk_tree_view_set_column_drag_info): Fix some errors in the
handling of drop columns. (#143355, John Finlay)
......
......@@ -5847,6 +5847,32 @@ gtk_widget_set_events (GtkWidget *widget,
g_object_notify (G_OBJECT (widget), "events");
}
static void
gtk_widget_add_events_internal (GtkWidget *widget,
gint events,
GList *window_list)
{
GList *l;
for (l = window_list; l != NULL; l = l->next)
{
GdkWindow *window = l->data;
gpointer user_data;
gdk_window_get_user_data (window, &user_data);
if (user_data == widget)
{
GList *children;
gdk_window_set_events (window, gdk_window_get_events (window) | events);
children = gdk_window_get_children (window);
gtk_widget_add_events_internal (widget, events, children);
g_list_free (children);
}
}
}
/**
* gtk_widget_add_events:
* @widget: a #GtkWidget
......@@ -5885,28 +5911,16 @@ gtk_widget_add_events (GtkWidget *widget,
if (GTK_WIDGET_REALIZED (widget))
{
if (GTK_WIDGET_NO_WINDOW (widget))
{
GList *children = gdk_window_get_children (widget->window);
GList *tmp_list = children;
GList *window_list;
while (tmp_list)
{
GdkWindow *window = tmp_list->data;
gpointer user_data;
if (GTK_WIDGET_NO_WINDOW (widget))
window_list = gdk_window_get_children (widget->window);
else
window_list = g_list_prepend (NULL, widget->window);
gdk_window_get_user_data (window, &user_data);
if (user_data == widget)
gdk_window_set_events (window, gdk_window_get_events (window) | events);
tmp_list = tmp_list->next;
}
gtk_widget_add_events_internal (widget, events, window_list);
g_list_free (children);
}
else
{
gdk_window_set_events (widget->window, gdk_window_get_events (widget->window) | events);
}
g_list_free (window_list);
}
g_object_notify (G_OBJECT (widget), "events");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment