--- metacity-2.22.0/src/core/window.c.origi	2008-05-22 15:40:44.761072000 +0800
+++ metacity-2.22.0/src/core/window.c	2008-05-22 15:42:15.270058000 +0800
@@ -2561,6 +2561,12 @@
   maximize_vertically   = directions & META_MAXIMIZE_VERTICAL;
   g_assert (maximize_horizontally || maximize_vertically);
 
+  if (window->display->grab_wireframe_active)
+    {
+      window->display->grab_wireframe_active = FALSE;
+      meta_window_end_wireframe(window->display->grab_window);
+    }  
+
   /* Only do something if the window isn't already maximized in the
    * given direction(s).
    */
@@ -2642,6 +2648,12 @@
   unmaximize_vertically   = directions & META_MAXIMIZE_VERTICAL;
   g_assert (unmaximize_horizontally || unmaximize_vertically);
 
+  if (window->display->grab_wireframe_active)
+    {
+      window->display->grab_wireframe_active = FALSE;
+      meta_window_end_wireframe(window->display->grab_window);
+    }  
+
   /* Only do something if the window isn't already maximized in the
    * given direction(s).
    */
