Subject: FVWM: moving windows patch

From: Henrique Martins <[email-masked]>
Date: Mon, 26 Feb 1996 20:53:56 -0800

I think I haven't tried hacking fvwm's code since way back in 0.9/1.x
  times, pre-modules, so I'm not sure of all the side effects of the
  changes below, specially on the impact on inter-module traffic and module
  behavior, but this patch will make the "window icons" in the pager move,
  while a window is being moved by fvwm, i.e. non-pager initiated moves.

  I've looked at coding the reverse effect, i.e. having the real windows
  move, while the pager icons move, but that is much more complicated, and
  I think I remember what happened when Rob try to do it, and things got in
  a nice seemingly endless loop, where the icon will move, would tell the
  window to move, which would cause the pager icon to move, etc.

  -- Henrique ([email-masked])

*** move.c.orig	Mon Feb 26 19:59:18 1996
--- move.c	Mon Feb 26 17:58:27 1996
***************
*** 112,117 ****
--- 112,118 ----
    Bool finished = False;
    Bool done;
    int xl,yt,delta_x,delta_y;
+   FvwmWindow duplicate;
  
    XQueryPointer(dpy, Scr.Root, &JunkRoot, &JunkChild,&xl, &yt,
  		&JunkX, &JunkY, &JunkMask);
***************
*** 123,128 ****
--- 124,131 ----
  
    DisplayPosition(tmp_win,xl+Scr.Vx,yt+Scr.Vy,True);
  
+   duplicate = *tmp_win;
+ 
    while (!finished)
      {
        /* block until there is an interesting event */
***************
*** 242,247 ****
--- 245,254 ----
  		XMoveWindow(dpy,tmp_win->frame,xl,yt);
  	    }
  	  DisplayPosition(tmp_win,xl+Scr.Vx,yt+Scr.Vy,False);
+           duplicate.frame_x = xl;
+           duplicate.frame_y = yt;
+           BroadcastConfig (M_CONFIGURE_WINDOW,&duplicate);
+           FlushQueues ();
  	  done = TRUE;
  	  break;
  
*** events.c.orig	Mon Feb 26 19:59:08 1996
--- events.c	Mon Feb 26 20:03:19 1996
***************
*** 1444,1446 ****
--- 1444,1483 ----
    return 0;
  }
  
+ void FlushQueues ()
+ {
+   extern int fd_width;
+   fd_set out_fdset;
+   int i;
+   int retval;
+ 
+   FD_ZERO(&out_fdset);
+   for(i=0; i<npipes; i++)
+     {
+       if(pipeQueue[i]!= NULL)
+ 	{
+ 	  FD_SET(writePipes[i], &out_fdset);
+ 	}
+     }
+   
+   XFlush(dpy);
+ #ifdef __hpux
+   retval=select(fd_width, 0, (int *)&out_fdset,0, NULL);
+ #else
+   retval=select(fd_width, 0, &out_fdset, 0, NULL);
+ #endif
+   
+   for(i=0;i<npipes;i++)
+     {
+       if(writePipes[i] >= 0)
+ 	{
+ 	  if((retval>0)&&(FD_ISSET(writePipes[i], &out_fdset)))
+ 	    {
+ 	      FlushQueue(i);
+ 	    }
+ 	}
+     }
+ 
+ }
+ 

--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].