gtk2/0001-Avoid-drawing-implicit-paints-to-destroyed-windows.patch
2010-01-15 16:45:15 +00:00

40 lines
1.4 KiB
Diff

From f96e51db46f2196707c0ea44a46f1d67f9a069d4 Mon Sep 17 00:00:00 2001
From: Alexander Larsson <alexl@redhat.com>
Date: Fri, 15 Jan 2010 16:06:12 +0100
Subject: [PATCH] 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
---
gdk/gdkwindow.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index eeaee78..9e6b14a 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -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);
--
1.6.6