From: Andrew Veliath <[email-masked]>
Date: Sun, 12 Jan 1997 19:36:58 -0500 (EST)

I just figured out how to use the FlipFocus function -- thanks to
Dan Niles for writing this.  However some documentation would be real
nice for :-).

However, one thing that drove me nuts was that any complex function
incurred a delay for the ClickTime, which made making a ToggleWindow
Complex function kind of annoying (this has nothing to do with FlipFocus).  

I've written a patch which lets you give the Function command an argument
causing it to only execute "I" (Immediate) parameters to the function. 
This makes complex functions such as the following ToggleWindow *much*
more responsive (especially with larger ClickTime settings). 

Here is the extracted parts of my rc that uses FlipFocus (with the new
Function -I option, which makes it only run the Immedate functions):

Key Tab		A	C	Function -I ToggleWindow

AddToFunc FocusWindow
+				"I" Focus
+				"I" WarpToWindow 10 10

AddToFunc ToggleWindow
+				"I" FlipFocus
+				"I" Prev [!iconic] Function -I FocusWindow

If you don't use the following patch, take out the -I option (make
ClickTime like 500 to see what I mean).

Patch for the -I option to Function (ComplexFunction in complex.c) to
make it only execute the Immediate portions of a function and return,
speeding it up for some situations.  If there is a way to obtain this
speedup without this patch, I'd love to hear it!

*** orig/fvwm-2.0.44-almost.andrew/fvwm/complex.c	Fri Apr 19 10:00:41 1996
--- fvwm-2.0.44-almost/fvwm/complex.c	Sun Jan 12 19:10:33 1997
***************
*** 72,94 ****
    Bool Persist = False;
    Bool HaveDoubleClick = False;
    Bool NeedsTarget = False;
    char *arguments[10], *junk, *taction;
    int x, y ,i;
    XEvent d, *ev;
    MenuRoot *mr;
    extern Bool desperate;
  
!   mr = FindPopup(action);
    if(mr == NULL)
      {
        if(!desperate)
! 	fvwm_msg(ERR,"ComplexFunction","No such function %s",action);
        return;
      }
    desperate = 0;
-   /* Get the argument list */
-   /* First entry in action is the function-name, ignore it */
-   action = GetNextToken(action,&junk);
    if(junk != NULL)
      free(junk);
    for(i=0;i<10;i++)
--- 72,100 ----
    Bool Persist = False;
    Bool HaveDoubleClick = False;
    Bool NeedsTarget = False;
+   Bool OnlyImmediate = False;
    char *arguments[10], *junk, *taction;
    int x, y ,i;
    XEvent d, *ev;
    MenuRoot *mr;
    extern Bool desperate;
  
!   /* Get the argument list */
!   /* First entry in action is the function-name, ignore it */
!   action = GetNextToken(action,&junk);
!   if(mystrncasecmp(junk,"-I",2)==0) {
!       OnlyImmediate = True;
!       if (junk) free(junk);
!       action = GetNextToken(action,&junk);
!   }
!   mr = FindPopup(junk);
    if(mr == NULL)
      {
        if(!desperate)
! 	fvwm_msg(ERR,"ComplexFunction","No such function %s",junk);
        return;
      }
    desperate = 0;
    if(junk != NULL)
      free(junk);
    for(i=0;i<10;i++)
***************
*** 144,150 ****
  	NeedsTarget = True;
        if(isupper(c))
  	c=tolower(c);
!       if(c==DOUBLE_CLICK)
  	{
  	  HaveDoubleClick = True;
  	  Persist = True;
--- 150,156 ----
  	NeedsTarget = True;
        if(isupper(c))
  	c=tolower(c);
!       if(!OnlyImmediate && (c==DOUBLE_CLICK))
  	{
  	  HaveDoubleClick = True;
  	  Persist = True;
***************
*** 164,170 ****
        mi = mi->next;
      }
  
!   if(!Persist)
      {
        for(i=0;i<10;i++)
  	  if(arguments[i] != NULL)free(arguments[i]);
--- 170,176 ----
        mi = mi->next;
      }
  
!   if(!Persist || OnlyImmediate)
      {
        for(i=0;i<10;i++)
  	  if(arguments[i] != NULL)free(arguments[i]);
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked].