[gtk+] Don't invalidate unnecessary areas on raise
- From: Alexander Larsson <alexl src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gtk+] Don't invalidate unnecessary areas on raise
- Date: Mon, 10 Aug 2009 13:37:47 +0000 (UTC)
commit 19c1c11322baa4fc8a1314b6550665414fdc4f60
Author: Alexander Larsson <alexl redhat com>
Date: Mon Aug 10 15:35:33 2009 +0200
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)
gdk/gdkwindow.c | 17 ++++++++++++++++-
1 files changed, 16 insertions(+), 1 deletions(-)
---
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index fc0a237..63e5d7d 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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]