[gtk+/client-side-windows: 65/284] Various fixes for native windows:



commit 4a0cb4a2407707834b5181e8a7210266f389ee97
Author: Alexander Larsson <alexl redhat com>
Date:   Thu Dec 18 13:36:52 2008 +0100

    Various fixes for native windows:
    move_region_on_impl() - doesn't need to copy anything if dx/dy == 0
    Ensure that we queue an update when invalidating an empty area but we have outstanding moves
    Temporarily unset background when moving native child windows
---
 gdk/gdkwindow.c           |   15 +++++++++++++--
 gdk/x11/gdkgeometry-x11.c |   15 ++++++++++-----
 gdk/x11/gdkwindow-x11.c   |   36 +++++++++++++++---------------------
 3 files changed, 38 insertions(+), 28 deletions(-)

diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index 4e4051f..991c164 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -2382,6 +2382,12 @@ move_region_on_impl (GdkWindowObject *private,
   GdkWindowObject *impl_window;
   gboolean free_region;
 
+  if (dx == 0 && dy == 0)
+    {
+      gdk_region_destroy (region);
+      return;
+    }
+  
   free_region = TRUE;
   impl_window = gdk_window_get_impl_window (private);
 
@@ -4567,14 +4573,19 @@ gdk_window_invalidate_maybe_recurse (GdkWindow       *window,
 
       tmp_list = tmp_list->next;
     }
+
+  impl_window = gdk_window_get_impl_window (private);
   
-  if (!gdk_region_empty (visible_region))
+  if (!gdk_region_empty (visible_region)  ||
+      /* Even if we're not exposing anything, make sure we process
+	 idles for windows with outstanding moves */
+      (impl_window->outstanding_moves != NULL &&
+       impl_window->update_area == NULL))
     {
       if (debug_updates)
         draw_ugly_color (window, region);
       
       /* Convert to impl coords */
-      impl_window = gdk_window_get_impl_window (private);
       gdk_region_offset (visible_region, private->abs_x, private->abs_y);
       if (impl_window->update_area)
 	{
diff --git a/gdk/x11/gdkgeometry-x11.c b/gdk/x11/gdkgeometry-x11.c
index 93851b4..b1fbe1c 100644
--- a/gdk/x11/gdkgeometry-x11.c
+++ b/gdk/x11/gdkgeometry-x11.c
@@ -190,17 +190,18 @@ _gdk_window_move_resize_child (GdkWindow *window,
   GdkWindowImplX11 *impl;
   GdkWindowObject *obj;
   GdkRectangle new_info;
-  
-  gint dx, dy;
-  gboolean is_move;
   gboolean is_resize;
-
+  
   g_return_if_fail (window != NULL);
   g_return_if_fail (GDK_IS_WINDOW (window)); 
 
   impl = GDK_WINDOW_IMPL_X11 (GDK_WINDOW_OBJECT (window)->impl);
   obj = GDK_WINDOW_OBJECT (window);
 
+  is_resize =
+    width != obj->width ||
+    height != obj->height;
+    
   obj->x = x;
   obj->y = y;
   obj->width = width;
@@ -210,11 +211,15 @@ _gdk_window_move_resize_child (GdkWindow *window,
   new_info.y = obj->y + obj->parent->abs_y;
   new_info.width = obj->width;
   new_info.height = obj->height;
-  
+
+  _gdk_x11_window_tmp_unset_bg (window, TRUE);
+  _gdk_x11_window_tmp_unset_bg (obj->parent, FALSE);
   if (is_resize)
     move_resize (window, &new_info);
   else
     move (window, &new_info);
+  _gdk_x11_window_tmp_reset_bg (obj->parent, FALSE);
+  _gdk_x11_window_tmp_reset_bg (window, TRUE);
 }
 
 static Bool
diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c
index 4f58d13..c64e458 100644
--- a/gdk/x11/gdkwindow-x11.c
+++ b/gdk/x11/gdkwindow-x11.c
@@ -290,18 +290,15 @@ _gdk_x11_window_tmp_unset_bg (GdkWindow *window,
 
   if (private->input_only || private->destroyed ||
       (private->window_type != GDK_WINDOW_ROOT &&
-       !GDK_WINDOW_IS_MAPPED (window)) ||
-      !_gdk_window_has_impl (window) ||
-      !GDK_WINDOW_IS_X11 (window))
-    {
-      return;
-    }
-
-  if (private->window_type != GDK_WINDOW_ROOT &&
+       !GDK_WINDOW_IS_MAPPED (window)))
+    return;
+  
+  
+  if (_gdk_window_has_impl (window) &&
+      GDK_WINDOW_IS_X11 (window) &&
+      private->window_type != GDK_WINDOW_ROOT &&
       private->window_type != GDK_WINDOW_FOREIGN)
-    {
-      tmp_unset_bg (window);
-    }
+    tmp_unset_bg (window);
 
   if (recurse)
     {
@@ -324,18 +321,15 @@ _gdk_x11_window_tmp_reset_bg (GdkWindow *window,
 
   if (private->input_only || private->destroyed ||
       (private->window_type != GDK_WINDOW_ROOT &&
-       !GDK_WINDOW_IS_MAPPED (window)) ||
-      !_gdk_window_has_impl (window) ||
-      !GDK_WINDOW_IS_X11 (window))
-    {
-      return;
-    }
+       !GDK_WINDOW_IS_MAPPED (window)))
+    return;
 
-  if (private->window_type != GDK_WINDOW_ROOT &&
+  
+  if (_gdk_window_has_impl (window) &&
+      GDK_WINDOW_IS_X11 (window) &&
+      private->window_type != GDK_WINDOW_ROOT &&
       private->window_type != GDK_WINDOW_FOREIGN)
-    {
-      tmp_reset_bg (window);
-    }
+    tmp_reset_bg (window);
 
   if (recurse)
     {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]