Commit f96e51db authored by Alexander Larsson's avatar Alexander Larsson

Avoid drawing implicit paints to destroyed windows

It may happen that a window gets destroyed during painting, if so
we should not draw the implicit paint double-buffered pixmap to it
as that will cause a BadDrawable X error.

This fixes bug 600865
parent 1e6df1df
......@@ -2679,7 +2679,7 @@ gdk_window_flush_implicit_paint (GdkWindow *window)
gdk_region_offset (region, private->abs_x, private->abs_y);
gdk_region_intersect (region, paint->region);
if (!gdk_region_empty (region))
if (!GDK_WINDOW_DESTROYED (window) && !gdk_region_empty (region))
/* Remove flushed region from the implicit paint */
gdk_region_subtract (paint->region, region);
......@@ -2712,7 +2712,7 @@ gdk_window_end_implicit_paint (GdkWindow *window)
private->implicit_paint = NULL;
if (!gdk_region_empty (paint->region))
if (!GDK_WINDOW_DESTROYED (window) && !gdk_region_empty (paint->region))
/* Some regions are valid, push these to window now */
tmp_gc = _gdk_drawable_get_scratch_gc ((GdkDrawable *)window, FALSE);
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment