FVWM: Small patch to FvwmPager for the button-impaired

From: Jay \ <Jay.Han_at_imag.fr>
Date: Mon, 5 Aug 1996 14:47:32 +0200

Hi all,

FVWM is a great piece of software and the best window manager around.
There's a single nagging bit with FvwmPager and the fact that my machine
is a notebook with a PS/2 trackpoint and only 2 mouse buttons. The
button semantics of FvwmPager is hard-coded, and moving windows is
associated with dragging with mouse button 2 down. Under XFree86, button
2 is emulated by pressing both buttons, which is quite a pain. I know I
could have tweaked the Xmodmap to reorder the button, but that would
break the other applications' interface.

So, after this lengthy introduction, here's a tiny patch to FvwmPager.
What it does is add a config option *FvwmPagerSwapButtons to swap
buttons 3 and 2. When that option is specified in .fvwmrc, moving
windows is mapped to button 3 drag and positioning the screen is mapped
to button 2. Additionally, focus without screen change is mapped to
button 3 click. That's it.

It's really a quick hack that isn't destined to get into the official
source. I think I read somewhere sometime ago that a more flexible
button mapping configuration parser was planned for FvwmPager. Until
then, this patch could help the button-impaired. It helps my poor
fingers a lot. :-)

To apply the patch, do "diff < patch.swapbuttons" in the
modules/FvwmPager directory.

------------------------------------------------------------------------
--- FvwmPager.c Wed Jul 31 19:23:17 1996
+++ FvwmPager.c.orig Wed Jul 31 19:22:57 1996
_at_@ -151,8 +151,6 @@
   
   Scr.screen= DefaultScreen(dpy);
   Scr.Root = RootWindow(dpy, Scr.screen);
- Scr.SwappedButton2 = 2;
- Scr.SwappedButton3 = 3;
   
   if(Scr.Root == None)
     {
_at_@ -961,12 +959,6 @@
                              Clength+12)==0))
         {
           StartIconic = 1;
- }
- else if((strlen(&tline[0])>1)&&
- (mystrncasecmp(tline,CatString3("*",MyName,"SwapButtons"),
- Clength+12)==0))
- {
- Scr.SwappedButton2 = 3; Scr.SwappedButton3 = 2;
         }
       else if((strlen(&tline[0])>1)&&
               (mystrncasecmp(tline,CatString3("*",MyName,"Rows"),
--- FvwmPager.h Wed Jul 31 19:23:17 1996
+++ FvwmPager.h.orig Wed Jul 31 19:23:02 1996
_at_@ -4,7 +4,6 @@
   int d_depth; /* copy of DefaultDepth(dpy, screen) */
   int MyDisplayWidth; /* my copy of DisplayWidth(dpy, screen) */
   int MyDisplayHeight; /* my copy of DisplayHeight(dpy, screen) */
- int SwappedButton2, SwappedButton3;
   
   char *FvwmRoot; /* the head of the fvwm window list */
   Window Root; /* the root window */
--- x_pager.c Wed Jul 31 19:23:23 1996
+++ x_pager.c.orig Wed Jul 31 19:23:07 1996
_at_@ -444,7 +444,7 @@
       break;
     case ButtonRelease:
       if((Event->xbutton.button == 1)||
- (Event->xbutton.button == Scr.SwappedButton3))
+ (Event->xbutton.button == 2))
         {
           for(i=0;i<ndesks;i++)
             {
_at_@ -458,7 +458,7 @@
               IconSwitchPage(Event);
             }
         }
- else if (Event->xbutton.button == Scr.SwappedButton2)
+ else if (Event->xbutton.button == 3)
         {
           for(i=0;i<ndesks;i++)
             {
_at_@ -478,14 +478,14 @@
         }
       break;
     case ButtonPress:
- if (((Event->xbutton.button == Scr.SwappedButton2)||
- ((Event->xbutton.button == Scr.SwappedButton3)&&
+ if (((Event->xbutton.button == 2)||
+ ((Event->xbutton.button == 3)&&
             (Event->xbutton.state & Mod1Mask)))&&
           (Event->xbutton.subwindow != None))
         {
           MoveWindow(Event);
         }
- else if (Event->xbutton.button == Scr.SwappedButton3)
+ else if (Event->xbutton.button == 3)
         {
           for(i=0;i<ndesks;i++)
             {
------------------------------------------------------------------------

-- 
-- Jay "Thierry" Han - Jay.Han_at_imag.fr - +33 76.61.52.70 - Perso: 76.46.11.26
La SF en francais : <URL:http://www-bi.inrialpes.fr/cgi-bin/han/francais.html>
LSR-IMAG. Unite de Recherche INRIA Rhone-Alpes. 
655 av. de l'Europe. 38330 Montbonnot-St.Martin. France.     Fax: 76.61.52.52
--
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 majordomo_at_hpc.uh.edu.
To report problems, send mail to fvwm-owner_at_hpc.uh.edu.
Received on Mon Aug 05 1996 - 07:49:42 BST

This archive was generated by hypermail 2.3.0 : Mon Aug 29 2016 - 19:37:59 BST