Index: gtk/gdk/x11/gdkgeometry-x11.c
===================================================================
--- gtk.orig/gdk/x11/gdkgeometry-x11.c
+++ gtk/gdk/x11/gdkgeometry-x11.c
@@ -338,6 +338,22 @@ move_resize (GdkWindow *window, GdkRecta
 }
 
 static void
+queue_translation_if_ltz (GdkWindow *window, gint dx, gint dy)
+{
+    if (dx < 0 || dy < 0)
+        gdk_window_queue_translation (window, NULL,
+                                      MIN (dx, 0), MIN (dy, 0));
+}
+
+static void
+queue_translation_if_gtz (GdkWindow *window, gint dx, gint dy)
+{
+    if (dx > 0 || dy > 0)
+        gdk_window_queue_translation (window, NULL,
+                                      MAX (dx, 0), MAX (dy, 0));
+}
+
+static void
 gdk_window_guffaw_scroll (GdkWindow    *window,
 			  gint          dx,
 			  gint          dy)
@@ -359,8 +375,7 @@ gdk_window_guffaw_scroll (GdkWindow    *
 
   _gdk_x11_window_tmp_unset_bg (window, FALSE);;
 
-  if (dx > 0 || dy > 0)
-    gdk_window_queue_translation (window, NULL, MAX (dx, 0), MAX (dy, 0));
+  queue_translation_if_gtz (window, dx, dy);
 	
   gdk_window_set_static_gravities (window, TRUE);
 
@@ -382,8 +397,7 @@ gdk_window_guffaw_scroll (GdkWindow    *
   
   move_relative (window, &new_position, -d_xoffset, -d_yoffset);
   
-  if (dx < 0 || dy < 0)
-    gdk_window_queue_translation (window, NULL, MIN (dx, 0), MIN (dy, 0));
+  queue_translation_if_ltz (window, dx, dy);
   
   move_resize (window, (GdkRectangle *) &impl->position_info);
   
@@ -683,8 +697,7 @@ _gdk_window_move_resize_child (GdkWindow
 
       gdk_window_set_static_gravities (window, TRUE);
 
-      if (d_xoffset < 0 || d_yoffset < 0)
-	gdk_window_queue_translation (window, NULL, MIN (d_xoffset, 0), MIN (d_yoffset, 0));
+      queue_translation_if_ltz (window, d_xoffset, d_yoffset);
 
       compute_intermediate_position (&impl->position_info, &new_info, d_xoffset, d_yoffset,
 				     &new_position);
@@ -695,8 +708,7 @@ _gdk_window_move_resize_child (GdkWindow
 
       move_relative (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));
+      queue_translation_if_gtz (window, d_xoffset, d_yoffset);
       
       move_resize (window, (GdkRectangle *) &new_info);
 
@@ -920,8 +932,7 @@ gdk_window_premove (GdkWindow          *
     {
       GdkRectangle new_position;
 
-      if (d_xoffset < 0 || d_yoffset < 0)
-	gdk_window_queue_translation (window, NULL, MIN (d_xoffset, 0), MIN (d_yoffset, 0));
+      queue_translation_if_ltz (window, d_xoffset, d_yoffset);
 
       compute_intermediate_position (&impl->position_info, &new_info, d_xoffset, d_yoffset,
 				     &new_position);
@@ -954,9 +965,7 @@ gdk_window_postmove (GdkWindow          
   
   if (d_xoffset != 0 || d_yoffset != 0)
     {
-      if (d_xoffset > 0 || d_yoffset > 0)
-	gdk_window_queue_translation (window, NULL, MAX (d_xoffset, 0), MAX (d_yoffset, 0));
-	
+      queue_translation_if_gtz (window, d_xoffset, d_yoffset);
       move_resize (window, (GdkRectangle *) &new_info);
     }
 
