--- window.c	22 Jan 2005 10:14:24 +0000	1.361
+++ window.c	22 Jan 2005 11:26:14 +0000	
@@ -2895,9 +2895,9 @@
 
   if ( rect.x >= work_area->x &&
        rect.y >= work_area->y &&
-       (((work_area->width - work_area->x) - rect.width) <
+       (((work_area->width + work_area->x) - (rect.width + rect.x)) <
         window->size_hints.width_inc) &&
-       (((work_area->height - work_area->y) - rect.height) <
+       (((work_area->height + work_area->y) - (rect.height + rect.y)) <
         window->size_hints.height_inc) )
     meta_window_maximize (window);
 }
