--- src/old-actions.c	2005-10-21 11:58:14.000000000 +0200
+++ src/actions.c	2006-04-26 23:15:23.000000000 +0200
@@ -112,6 +112,13 @@
   new_width   = (retmask & WidthValue)  ? new_width   : width;
   new_height  = (retmask & HeightValue) ? new_height  : height;
 
+  int screen = DefaultScreen(gdk_display);
+  int screen_width  = DisplayWidth (gdk_display, screen);
+  int screen_height = DisplayHeight(gdk_display, screen);
+  /* new_xoffset and new_yoffset are negative */
+  if(retmask & XNegative) new_xoffset = screen_width  + new_xoffset - new_width;
+  if(retmask & YNegative) new_yoffset = screen_height + new_yoffset - new_height;
+
   /* try to set new position.. */
   my_wnck_error_trap_push ();
   XMoveResizeWindow (gdk_display,
