Subject: Bug#3407: fvwm2: WindowList infelicity

From: Austin Donnelly <[email-masked]>
Date: Thu, 27 Jun 96 12:22 BST

[This is also being archived via the Debian bugs system. Please pay
attention to which addresses you follow up to]

On Mon, 24 Jun 1996, Dave Holland wrote:

> Package: fvwm2
> Version: 2.0.42-BETA-0
> 
> In my .fvwm2rc I have the following bindings:
> 
> Mouse 3         R       A       WindowList
> Key F3          A       N       WindowList
> 
> i.e. the right-hand mouse button in the root window, OR the F3 key
> anywhere, will pop up the WindowList.
> 
> If I get the WindowList by clicking the mouse button, I can then
> immediately select a window by pressing 1, 2, 3... but if I obtain the
> WindowList by pressing F3, fvwm2 ignores the next key I press and only
> acts upon the following one.

I have investigated the problem, and can reproduce it.

I have put together a patch which fixes it (and a related problem with
the "menu" command).

However, although my fix works, it doesn 'feel' right. I am including
it here so as Chuck can see one solution to the problem, but with the
hope he'll come up with a better fix :)

Austin

------------------------------------------------------------
--- windows.c.orig	Tue Oct 17 16:01:06 1995
+++ windows.c	Thu Jun 27 11:53:01 1996
@@ -138,7 +138,17 @@
     }
   MakeMenu(mr);
 
-  do_menu(mr,1);
+  /* If the menu is a result of a ButtonPress, then tell do_menu()
+     to expect (and ignore) a button release event. Otherwise, it was
+     as a result of a keypress or something, so we shouldn't expect
+     a button release event. Fixes problem with keyboard short cuts not
+     working if window list is popped up by keyboard.
+         [email-masked], 27/6/96 */
+  if (eventp->type == ButtonPress)
+    do_menu(mr,1);
+  else
+    do_menu(mr,0);
+
   DestroyMenu(mr);
 }
 
--- builtins.c.orig	Wed Apr 10 18:38:25 1996
+++ builtins.c	Thu Jun 27 12:03:37 1996
@@ -810,7 +810,13 @@
   ActiveItem = NULL;
   ActiveMenu = NULL;
   menuFromFrameOrWindowOrTitlebar = FALSE;
-  do_menu(menu,1);
+
+  /* See bottom of windows.c for rationale behind this */
+  if (eventp->type == ButtonPress)
+    do_menu(menu,1);
+  else
+    do_menu(menu,0);
+
   if(menu_name != NULL)
     free(menu_name);
   if((menu_aborted)&&(default_action != NULL))
------------------------------------------------------------
--
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].

---

From: "Charles Hines" <[email-masked]>
Date: Thu, 27 Jun 1996 09:59:51 -0400

>>>>> "Austin" == Austin Donnelly <[email-masked]> writes:

>> acts upon the following one.

Austin> I have investigated the problem, and can reproduce it.

I knew about this, but hadn't looked into it yet.  Thanks for doing so.

Austin> I have put together a patch which fixes it (and a related problem with
Austin> the "menu" command).

Austin> However, although my fix works, it doesn 'feel' right. I am
Austin> including it here so as Chuck can see one solution to the
Austin> problem, but with the hope he'll come up with a better fix :)

Actually, it seems ok for now, so I'll just go with that.  When I
start cleaning things up later, perhaps I'll think about how to
reimplement it then.

Thanks,
Chuck