--- fvwm/resize.c.orig	Sat Sep 11 01:23:37 1999
+++ fvwm/resize.c	Sat Sep 11 01:39:18 1999
@@ -38,7 +38,8 @@
 extern Window PressedW;
 
 static void DoResize(int x_root, int y_root, FvwmWindow *tmp_win,
-		     geom *drag, geom *orig, int *xmotionp, int *ymotionp);
+		     geom *drag, geom *orig, int *xmotionp, int *ymotionp,
+		     Bool opaque);
 
 /****************************************************************************
  *
@@ -48,7 +49,7 @@
 void resize_window(XEvent *eventp,Window w,FvwmWindow *tmp_win,
 		   unsigned long context, char *action,int *Module)
 {
-  Bool finished = FALSE, done = FALSE, abort = FALSE;
+  Bool finished = FALSE, done = FALSE, abort = FALSE, opaque = FALSE;
   int x,y,delta_x,delta_y,stashed_x,stashed_y;
   Window ResizeWindow;
   Bool flags;
@@ -122,9 +123,6 @@
       return;
     }
 
-  MyXGrabServer(dpy);
-
-
   /* handle problems with edge-wrapping while resizing */
   flags = Scr.flags;
   Scr.flags &= ~(EdgeWrapX|EdgeWrapY);
@@ -133,6 +131,12 @@
 	       &drag->x, &drag->y, (unsigned int *)&drag->width,
 	       (unsigned int *)&drag->height, &JunkBW,&JunkDepth);
 
+  if(drag->width*drag->height < 
+     (Scr.OpaqueSize*Scr.MyDisplayWidth*Scr.MyDisplayHeight)/100)
+    opaque = True;
+  else
+    MyXGrabServer(dpy);
+
   drag->x += tmp_win->bw;
   drag->y += tmp_win->bw;
   orig->x = drag->x;
@@ -178,15 +182,16 @@
 	}
     }
   /* draw the rubber-band window */
-  MoveOutline (Scr.Root, drag->x - tmp_win->bw, drag->y - tmp_win->bw,
-	       drag->width - 1 + 2 * tmp_win->bw,
-	       drag->height - 1 + 2 * tmp_win->bw);
+  if(!opaque)
+    MoveOutline(Scr.Root, drag->x - tmp_win->bw, drag->y - tmp_win->bw,
+	        drag->width - 1 + 2 * tmp_win->bw,
+	        drag->height - 1 + 2 * tmp_win->bw);
   /* kick off resizing without requiring any motion if invoked with a key press */
   if (eventp->type == KeyPress)
     {
       XQueryPointer(dpy, Scr.Root, &JunkRoot, &JunkChild,
                     &stashed_x,&stashed_y,&JunkX, &JunkY, &JunkMask);
-      DoResize(stashed_x, stashed_y, tmp_win, drag, orig, &xmotion, &ymotion);
+      DoResize(stashed_x, stashed_y, tmp_win, drag, orig, &xmotion, &ymotion, opaque);
     }
   else
     stashed_x = stashed_y = -1;
@@ -257,7 +262,7 @@
 	  y = Event.xmotion.y_root;
 	  /* resize before paging request to prevent resize from lagging
 	   * mouse - mab */
-	  DoResize(x, y, tmp_win, drag, orig, &xmotion, &ymotion);
+	  DoResize(x, y, tmp_win, drag, orig, &xmotion, &ymotion, opaque);
 	  /* need to move the viewport */
 	  HandlePaging(Scr.EdgeScrollX,Scr.EdgeScrollY,&x,&y,
 		       &delta_x,&delta_y,False);
@@ -269,13 +274,13 @@
 	    drag->x -= delta_x;
 	    drag->y -= delta_y;
 
-	    DoResize(x, y, tmp_win, drag, orig, &xmotion, &ymotion);
+	    DoResize(x, y, tmp_win, drag, orig, &xmotion, &ymotion, opaque);
 	  }
 	  done = TRUE;
 	default:
 	  break;
 	}
-      if(!done)
+      if(!done && !opaque)
 	{
 	  MoveOutline(Scr.Root,0,0,0,0);
 	  DispatchEvent();
@@ -287,12 +292,13 @@
     }
 
   /* erase the rubber-band */
-  MoveOutline(Scr.Root, 0, 0, 0, 0);
+  if(!opaque)
+    MoveOutline(Scr.Root, 0, 0, 0, 0);
 
   /* pop down the size window */
   XUnmapWindow(dpy, Scr.SizeWindow);
 
-  if(!abort)
+  if(!abort && !opaque)
     {
       /* size will be >= to requested */
       ConstrainSize (tmp_win, &drag->width, &drag->height, True, xmotion,
@@ -302,7 +308,8 @@
     }
   UninstallRootColormap();
   ResizeWindow = None;
-  MyXUngrabServer(dpy);
+  if(!opaque)
+    MyXUngrabServer(dpy);
   UngrabEm();
   xmotion = 0;
   ymotion = 0;
@@ -331,7 +338,8 @@
  *
  ************************************************************************/
 static void DoResize(int x_root, int y_root, FvwmWindow *tmp_win,
-		     geom *drag, geom *orig, int *xmotionp, int *ymotionp)
+		     geom *drag, geom *orig, int *xmotionp, int *ymotionp,
+		     Bool opaque)
 {
   int action=0;
 
@@ -379,9 +387,13 @@
       if (*ymotionp == 1)
 	drag->y = orig->y + orig->height - drag->height;
 
-      MoveOutline(Scr.Root, drag->x - tmp_win->bw,drag->y - tmp_win->bw,
-		  drag->width - 1 + 2 * tmp_win->bw,
-		  drag->height - 1 + 2 * tmp_win->bw);
+      if(!opaque)
+	MoveOutline(Scr.Root, drag->x - tmp_win->bw,drag->y - tmp_win->bw,
+		    drag->width - 1 + 2 * tmp_win->bw,
+		    drag->height - 1 + 2 * tmp_win->bw);
+      else
+	SetupFrame(tmp_win, drag->x - tmp_win->bw,
+		   drag->y - tmp_win->bw, drag->width, drag->height, FALSE);
     }
   DisplaySize(tmp_win, drag->width, drag->height,False,False);
 }

