Subject: New fvwm command: PrevPage

From: Nagi M Aboulenein <[email-masked]>
Date: Thu, 18 Mar 1999 09:44:12 -0800

Hi,

I've been using fvwm for ages, and at some point I put together a new
command called PrevPage. What PrevPage does is that it toggles between
the current page and the previous page. I.e., you can rapidly flip
between the last two pages without having to explicitly specify them. In
my .fvwm2rc I have bound this command to KP_Enter, and, personally
speaking, it is probably the most frequently used command that fvwm has.

For those interested, I have attached a patch for this command that
should be applied to fvwm-2.2 source. It would also be nice to see this
appear in the fvwm distribution.

Thanks.
--
Nagi Aboulenein
Disclaimer: I speak only for myself, not for Intel.

Index: fvwm/functions.c
*** fvwm-2.2/fvwm/functions.c	Tue Feb 16 08:11:43 1999
--- fvwm-2.2.new/fvwm/functions.c	Wed Mar 17 09:35:53 1999
***************
*** 135,140 ****
--- 135,141 ----
    {"PixmapPath",   setPixmapPath,    F_PIXMAP_PATH,         FUNC_NO_WINDOW},
    {"PopUp",        popup_func,       F_POPUP,               FUNC_NO_WINDOW},
    {"Prev",         PrevFunc,         F_PREV,                FUNC_NO_WINDOW},
+   {"PrevPage",     prev_page_func,   F_PREV_PAGE,            FUNC_NO_WINDOW},
    {"Quit",         quit_func,        F_QUIT,                FUNC_NO_WINDOW},
    {"QuitScreen",   quit_screen_func, F_QUIT_SCREEN,         FUNC_NO_WINDOW},
    {"Raise",        raise_function,   F_RAISE,               FUNC_NEEDS_WINDOW},
Index: fvwm/misc.h
*** fvwm-2.2/fvwm/misc.h	Tue Feb 16 08:11:44 1999
--- fvwm-2.2.new/fvwm/misc.h	Wed Mar 17 09:31:34 1999
***************
*** 138,143 ****
--- 138,147 ----
  extern char NoClass[];
  extern char NoResource[];
  
+ extern int prev_x;
+ extern int prev_y;
+ 
+ 
  /* Start of function prototype area.
     I wonder if there is any sequence to this stuff.
  
***************
*** 394,399 ****
--- 398,406 ----
  		    int *val2_unit);
  
  void goto_page_func(F_CMD_ARGS);
+ 
+ void prev_page_func(XEvent *eventp,Window w,FvwmWindow *tmp_win,
+ 		    unsigned long context, char *action, int *Module);
  
  void wait_func(F_CMD_ARGS);
  void flip_focus_func(F_CMD_ARGS);
Index: fvwm/parse.h
*** fvwm-2.2/fvwm/parse.h	Tue Jan 12 13:07:44 1999
--- fvwm-2.2.new/fvwm/parse.h	Wed Mar 17 09:32:31 1999
***************
*** 76,81 ****
--- 76,82 ----
      F_EXEC_SETUP,
      F_CURSOR_STYLE,
      F_CURRENT,
+     F_PREV_PAGE,
      F_SETENV,
      F_SET_ANIMATION,
      F_CHANGE_MENUSTYLE,
Index: fvwm/virtual.c
*** fvwm-2.2/fvwm/virtual.c	Wed Dec 23 17:28:11 1998
--- fvwm-2.2.new/fvwm/virtual.c	Wed Mar 17 09:35:47 1999
***************
*** 55,60 ****
--- 55,63 ----
    edge_thickness = val;
  }
  
+ int prev_x = 0;
+ int prev_y = 0;
+ 
  /***************************************************************************
   *
   * Check to see if the pointer is on the edge of the screen, and scroll/page
***************
*** 407,412 ****
--- 410,417 ----
    if(grab)
      MyXGrabServer(dpy);
  
+   prev_x = Scr.Vx;
+   prev_y = Scr.Vy;
  
    if(newx > Scr.VxMax)
      newx = Scr.VxMax;
***************
*** 887,892 ****
    MoveViewport(x,y,True);
  }
  
! 

--- 892,901 ----
    MoveViewport(x,y,True);
  }
  
! void prev_page_func (XEvent *eventp, Window w, FvwmWindow *tmp_win,
! 		     unsigned long context, char *action, int *Module)
! {
!   MoveViewport(prev_x, prev_y, True);
! }

---

From: Dominik Vogt <[email-masked]>
Date: Fri, 19 Mar 1999 20:44:04 +0100

> appear in the fvwm distribution.

If you give me some time I'll apply a slightly modified version that
does it as an option to GotoPage instead of a new command (easier to
find in the manpage).

Bye

Dominik

--
Dominik Vogt, [email-masked]
Reply-To: [email-masked]
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
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]