Bug 573069 – Gdk-CRITICAL warnings with Gtk 2.14 when dragging

GtkNotebook tabs

        * gtk/gtkwidget.c (_gtk_widget_synthesize_crossing): Be a little
        more careful when navigating up the parent chain.

        * gdk/gdkwindow.c (_gdk_window_destroy_hierarchy): Reset the
        pointer window thats stored on the screen when it is destroyed.


svn path=/trunk/; revision=22420
This commit is contained in:
Matthias Clasen 2009-02-28 05:24:07 +00:00
parent 3a8c0e370b
commit d0e7f5889e
3 changed files with 38 additions and 24 deletions

View File

@ -1,3 +1,14 @@
2009-02-28 Matthias Clasen <mclasen@redhat.com>
Bug 573069 Gdk-CRITICAL warnings with Gtk 2.14 when dragging
GtkNotebook tabs
* gtk/gtkwidget.c (_gtk_widget_synthesize_crossing): Be a little
more careful when navigating up the parent chain.
* gdk/gdkwindow.c (_gdk_window_destroy_hierarchy): Reset the
pointer window thats stored on the screen when it is destroyed.
2009-02-27 Matthias Clasen <mclasen@redhat.com>
Bug 572996 crash in Home Folder: Trying to open the sidebar

View File

@ -283,6 +283,8 @@ gdk_window_init (GdkWindowObject *window)
window->state = GDK_WINDOW_STATE_WITHDRAWN;
}
static GQuark quark_pointer_window = 0;
static void
gdk_window_class_init (GdkWindowObjectClass *klass)
{
@ -319,6 +321,8 @@ gdk_window_class_init (GdkWindowObjectClass *klass)
drawable_class->get_clip_region = gdk_window_get_clip_region;
drawable_class->get_visible_region = gdk_window_get_visible_region;
drawable_class->get_composite_drawable = gdk_window_get_composite_drawable;
quark_pointer_window = g_quark_from_static_string ("gtk-pointer-window");
}
static void
@ -490,10 +494,14 @@ _gdk_window_destroy_hierarchy (GdkWindow *window,
if (GDK_WINDOW_DESTROYED (window))
return;
screen = gdk_drawable_get_screen (GDK_DRAWABLE (window));
temp_window = g_object_get_qdata (G_OBJECT (screen), quark_pointer_window);
if (temp_window == window)
g_object_set_qdata (G_OBJECT (screen), quark_pointer_window, NULL);
switch (GDK_WINDOW_TYPE (window))
{
case GDK_WINDOW_ROOT:
screen = gdk_drawable_get_screen (GDK_DRAWABLE (window));
if (!screen->closed)
{
g_error ("attempted to destroy root window");
@ -2108,17 +2116,16 @@ gdk_window_clear_backing_rect_redirect (GdkWindow *window,
if (GDK_WINDOW_DESTROYED (window))
return;
paint.x_offset = x_offset;
paint.y_offset = y_offset;
paint.pixmap = redirect->pixmap;
paint.surface = _gdk_drawable_ref_cairo_surface (redirect->pixmap);
clip_region = _gdk_window_calculate_full_clip_region (window,
GDK_WINDOW (redirect->redirected),
NULL, TRUE,
&x_offset, &y_offset);
paint.x_offset = x_offset;
paint.y_offset = y_offset;
paint.pixmap = redirect->pixmap;
paint.surface = _gdk_drawable_ref_cairo_surface (redirect->pixmap);
method.cr = NULL;
method.gc = NULL;
setup_backing_rect_method (&method, window, &paint, 0, 0);

View File

@ -8246,13 +8246,10 @@ _gtk_widget_synthesize_crossing (GtkWidget *from,
while (from_ancestor != NULL)
{
if (from_ancestor != NULL)
{
from_ancestor = gdk_window_get_parent (from_ancestor);
if (from_ancestor == NULL)
break;
from_ancestors = g_list_prepend (from_ancestors, from_ancestor);
}
from_ancestor = gdk_window_get_parent (from_ancestor);
if (from_ancestor == NULL)
break;
from_ancestors = g_list_prepend (from_ancestors, from_ancestor);
}
synth_crossing (from, GDK_LEAVE_NOTIFY, from_window,
@ -8274,14 +8271,11 @@ _gtk_widget_synthesize_crossing (GtkWidget *from,
while (to_ancestor != NULL)
{
if (to_ancestor != NULL)
{
to_ancestor = gdk_window_get_parent (to_ancestor);
if (to_ancestor == NULL)
break;
to_ancestors = g_list_prepend (to_ancestors, to_ancestor);
}
}
to_ancestor = gdk_window_get_parent (to_ancestor);
if (to_ancestor == NULL)
break;
to_ancestors = g_list_prepend (to_ancestors, to_ancestor);
}
/* XXX: leave/inferior on root window? */
@ -8309,14 +8303,16 @@ _gtk_widget_synthesize_crossing (GtkWidget *from,
from_ancestor = gdk_window_get_parent (from_ancestor);
if (from_ancestor == to_window)
break;
from_ancestors = g_list_prepend (from_ancestors, from_ancestor);
if (from_ancestor)
from_ancestors = g_list_prepend (from_ancestors, from_ancestor);
}
if (to_ancestor != NULL)
{
to_ancestor = gdk_window_get_parent (to_ancestor);
if (to_ancestor == from_window)
break;
to_ancestors = g_list_prepend (to_ancestors, to_ancestor);
if (to_ancestor)
to_ancestors = g_list_prepend (to_ancestors, to_ancestor);
}
}
if (to_ancestor == from_window)