commit 2fbd476baf2c9386fe89da9d130d1c29c9c8acc7
Author: Tilman Sauerbeck <tilman@code-monkey.de>
Date:   Wed Apr 25 19:25:45 2007 +0200

    Added a few wrappers for XMoveWindow()/XMoveResizeWindow().

diff --git a/gdk/x11/gdkgeometry-x11.c b/gdk/x11/gdkgeometry-x11.c
index 7ae048c..dbb66a1 100644
--- a/gdk/x11/gdkgeometry-x11.c
+++ b/gdk/x11/gdkgeometry-x11.c
@@ -314,6 +314,38 @@ translate_pos (GdkWindowParentPos *src, GdkWindowParentPos *dest,
 }
 
 static void
+xmove (GdkWindow *window, GdkXPositionInfo *pos)
+{
+  XMoveWindow (GDK_WINDOW_XDISPLAY (window),
+               GDK_WINDOW_XID (window), pos->x, pos->y);
+}
+
+static void
+xmove_rel (GdkWindow *window, GdkRectangle *rect,
+           gint dx, gint dy)
+{
+  XMoveWindow (GDK_WINDOW_XDISPLAY (window),
+               GDK_WINDOW_XID (window),
+               rect->x + dx, rect->y + dy);
+}
+
+static void
+xmove_resize (GdkWindow *window, GdkRectangle *pos)
+{
+  XMoveResizeWindow (GDK_WINDOW_XDISPLAY (window),
+                     GDK_WINDOW_XID (window),
+                     pos->x, pos->y, pos->width, pos->height);
+}
+
+static void
+xmove_resize2 (GdkWindow *window, GdkXPositionInfo *pos)
+{
+  XMoveResizeWindow (GDK_WINDOW_XDISPLAY (window),
+                     GDK_WINDOW_XID (window),
+                     pos->x, pos->y, pos->width, pos->height);
+}
+
+static void
 gdk_window_guffaw_scroll (GdkWindow    *window,
 			  gint          dx,
 			  gint          dy)
@@ -343,9 +375,7 @@ gdk_window_guffaw_scroll (GdkWindow    *window,
   compute_intermediate_position (&impl->position_info, &new_info, d_xoffset, d_yoffset,
 				 &new_position);
   
-  XMoveResizeWindow (GDK_WINDOW_XDISPLAY (window),
-		     GDK_WINDOW_XID (window),
-		     new_position.x, new_position.y, new_position.width, new_position.height);
+  xmove_resize (window, &new_position);
   
   for (l = obj->children; l; l = l->next)
     {
@@ -358,17 +388,12 @@ gdk_window_guffaw_scroll (GdkWindow    *window,
       gdk_window_premove (child, &parent_pos);
     }
   
-  XMoveWindow (GDK_WINDOW_XDISPLAY (window),
-	       GDK_WINDOW_XID (window),
-	       new_position.x - d_xoffset, new_position.y - d_yoffset);
+  xmove_rel (window, &new_position, -d_xoffset, -d_yoffset);
   
   if (dx < 0 || dy < 0)
     gdk_window_queue_translation (window, NULL, MIN (dx, 0), MIN (dy, 0));
   
-  XMoveResizeWindow (GDK_WINDOW_XDISPLAY (window),
-		     GDK_WINDOW_XID (window),
-		     impl->position_info.x, impl->position_info.y,
-		     impl->position_info.width, impl->position_info.height);
+  xmove_resize2 (window, &impl->position_info);
   
   if (impl->position_info.no_bg)
     _gdk_x11_window_tmp_reset_bg (window, FALSE);
@@ -652,22 +677,16 @@ _gdk_window_move_resize_child (GdkWindow *window,
       compute_intermediate_position (&impl->position_info, &new_info, d_xoffset, d_yoffset,
 				     &new_position);
       
-      XMoveResizeWindow (GDK_WINDOW_XDISPLAY (window),
-			 GDK_WINDOW_XID (window),
-			 new_position.x, new_position.y, new_position.width, new_position.height);
+      xmove_resize (window, &new_position);
       
       g_list_foreach (obj->children, (GFunc) gdk_window_premove, &parent_pos);
 
-      XMoveWindow (GDK_WINDOW_XDISPLAY (window),
-		   GDK_WINDOW_XID (window),
-		   new_position.x + dx, new_position.y + dy);
+      xmove_rel (window, &new_position, dx, dy);
       
       if (d_xoffset > 0 || d_yoffset > 0)
 	gdk_window_queue_translation (window, NULL, MAX (d_xoffset, 0), MAX (d_yoffset, 0));
       
-      XMoveResizeWindow (GDK_WINDOW_XDISPLAY (window),
-			 GDK_WINDOW_XID (window),
-			 new_info.x, new_info.y, new_info.width, new_info.height);
+      xmove_resize2 (window, &new_info);
 
       reset_backgrounds (window);
 
@@ -689,13 +708,9 @@ _gdk_window_move_resize_child (GdkWindow *window,
       g_list_foreach (obj->children, (GFunc) gdk_window_premove, &parent_pos);
 
       if (is_resize)
-	XMoveResizeWindow (GDK_WINDOW_XDISPLAY (window),
-			   GDK_WINDOW_XID (window),
-			   new_info.x, new_info.y, new_info.width, new_info.height);
+          xmove_resize2 (window, &new_info);
       else
-	XMoveWindow (GDK_WINDOW_XDISPLAY (window),
-		     GDK_WINDOW_XID (window),
-		     new_info.x, new_info.y);
+          xmove (window, &new_info);
 
       g_list_foreach (obj->children, (GFunc) gdk_window_postmove, &parent_pos);
 
@@ -903,9 +918,7 @@ gdk_window_premove (GdkWindow          *window,
       compute_intermediate_position (&impl->position_info, &new_info, d_xoffset, d_yoffset,
 				     &new_position);
 
-      XMoveResizeWindow (GDK_DRAWABLE_XDISPLAY (window),
-			 GDK_DRAWABLE_XID (window),
-			 new_position.x, new_position.y, new_position.width, new_position.height);
+      xmove_resize (window, &new_position);
     }
 
   g_list_foreach (obj->children, (GFunc) gdk_window_premove, &this_pos);
@@ -936,9 +949,7 @@ gdk_window_postmove (GdkWindow          *window,
       if (d_xoffset > 0 || d_yoffset > 0)
 	gdk_window_queue_translation (window, NULL, MAX (d_xoffset, 0), MAX (d_yoffset, 0));
 	
-      XMoveResizeWindow (GDK_DRAWABLE_XDISPLAY (window),
-			 GDK_DRAWABLE_XID (window),
-			 new_info.x, new_info.y, new_info.width, new_info.height);
+      xmove_resize2 (window, &new_info);
     }
 
   if (!impl->position_info.mapped && new_info.mapped && GDK_WINDOW_IS_MAPPED (obj))
