Fix read of non-initialized clip_region

Foreign children are always viewable but may not have a viewable
parent, so ensure we don't read the parent for them.
This commit is contained in:
Alexander Larsson 2009-07-18 21:56:03 +02:00
parent 7adf894a29
commit 454160ad9e

View File

@ -783,7 +783,12 @@ recompute_visible_regions_internal (GdkWindowObject *private,
r.height = private->height;
new_clip = gdk_region_rectangle (&r);
if (private->parent != NULL && private->parent->window_type != GDK_WINDOW_ROOT)
if (private->parent != NULL &&
private->parent->window_type != GDK_WINDOW_ROOT &&
/* For foreign children, don't remove local parents, as parent
may not be mapped yet, and the non-native parents are not really
enforced for it anyways. */
private->window_type != GDK_WINDOW_FOREIGN)
{
gdk_region_intersect (new_clip, private->parent->clip_region);