diff options
author | Alexander Larsson <alexl@redhat.com> | 2009-08-10 15:35:33 +0200 |
---|---|---|
committer | Alexander Larsson <alexl@redhat.com> | 2009-08-10 15:35:33 +0200 |
commit | 19c1c11322baa4fc8a1314b6550665414fdc4f60 (patch) | |
tree | 1dbf8a24cf65c9f5047e876271d8e4c3db727b74 | |
parent | 0fc8c475a840527ec9a4bb030939f7c7e0dc0bde (diff) | |
download | gtk+-19c1c11322baa4fc8a1314b6550665414fdc4f60.tar.gz |
Don't invalidate unnecessary areas on raise
We used to invalidate the whole window when raised, but this is
unnecessary much, we now just invalidate the visible area minus the
previously visible area.
This also fixes a problem where expose calling raise caused a loop (#588438)
-rw-r--r-- | gdk/gdkwindow.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c index fc0a2379ae..63e5d7d85b 100644 --- a/gdk/gdkwindow.c +++ b/gdk/gdkwindow.c @@ -5978,6 +5978,7 @@ void gdk_window_raise (GdkWindow *window) { GdkWindowObject *private; + GdkRegion *old_region, *new_region; g_return_if_fail (GDK_IS_WINDOW (window)); @@ -5985,12 +5986,26 @@ gdk_window_raise (GdkWindow *window) if (private->destroyed) return; + old_region = NULL; + if (gdk_window_is_viewable (window) && + !private->input_only) + old_region = gdk_region_copy (private->clip_region); + /* Keep children in (reverse) stacking order */ gdk_window_raise_internal (window); recompute_visible_regions (private, TRUE, FALSE); - gdk_window_invalidate_rect (window, NULL, TRUE); + if (old_region) + { + new_region = gdk_region_copy (private->clip_region); + + gdk_region_subtract (new_region, old_region); + gdk_window_invalidate_region (window, new_region, TRUE); + + gdk_region_destroy (old_region); + gdk_region_destroy (new_region); + } } static void |