Make gdk_drawable_get_visible/clip_region handle the !viewable case

We can't access ->clip_region for these cases as its not yet calculated.
This commit is contained in:
Alexander Larsson 2009-07-20 22:30:48 +02:00
parent bf78db5690
commit 36861cf608

View File

@ -3493,13 +3493,24 @@ gdk_window_get_composite_drawable (GdkDrawable *drawable,
return tmp_pixmap;
}
static GdkRegion*
gdk_window_get_visible_region (GdkDrawable *drawable)
{
GdkWindowObject *private = (GdkWindowObject*) drawable;
if (private->viewable)
return gdk_region_copy (private->clip_region);
else
return gdk_region_new ();
}
static GdkRegion*
gdk_window_get_clip_region (GdkDrawable *drawable)
{
GdkWindowObject *private = (GdkWindowObject *)drawable;
GdkRegion *result;
result = gdk_region_copy (private->clip_region);
result = gdk_window_get_visible_region (drawable);
if (private->paint_stack)
{
@ -3522,14 +3533,6 @@ gdk_window_get_clip_region (GdkDrawable *drawable)
return result;
}
static GdkRegion*
gdk_window_get_visible_region (GdkDrawable *drawable)
{
GdkWindowObject *private = (GdkWindowObject*) drawable;
return gdk_region_copy (private->clip_region);
}
static void
gdk_window_draw_drawable (GdkDrawable *drawable,
GdkGC *gc,