Subject: 2.0.46 -> 2.0.47d Iconify troubles

From: Tim Phipps <[email-masked]>
Date: Tue, 21 Jul 1998 14:30:42 +0100

I've got a problem with iconifying windows using a mouse button that
doesn't happen with a key press.

I bind mouse button 3 on the border to the function my_iconify and I
bind the keypad_decimal key to the same function:

Key KP_Decimal WTSF N my_iconify
Mouse 3 TSF A my_resizeiconify

AddToFunc my_resizeiconify
+			"M" Resize
+			"C" my_iconify

AddToFunc my_iconify	"I" Iconify 1
+			"I" my_prev

AddToFunc my_prev	"I" Prev [!Iconic CurrentDesk] my_focus
+			"I" None [!Iconic CurrentDesk] my_previcon

AddToFunc my_previcon	"I" Prev [Iconic CurrentDesk] my_focus
+			"I" None [Iconic CurrentDesk] my_home

my_home warps the cursor into an FvwmButtons and my_focus raises and
focuses to the selected window.

What all this is supposed to achieve is that when I iconify a window the
focus moves to the previous window in the stack or to an icon if there
are no windows open (and the FvwmButtons if there are no icons).

This works fine from the key binding but with the mouse binding
something goes awry with the ordering of events.  The last window on a
desk cannot be iconified (well, it looks like it gets iconified and then
my_prev finds that window and runs my_focus which deiconifies it) and
sometimes whene ther are more than one window on the screen the wrong
window gets iconified (very annoying).  It feels like the first line of
my_prev is finding the last uniconified window on the screen and
focusing to it even though my_iconify has just iconified it.  The weird
thing is that it only fails if a mouse button is used.  The iconifying
of the wrong window might be related to the "Prev ... my_focus" moving
the focus before the Iconify 1 takes effect so it probably is one bug

Any ideas what changed between 2.0.46 and 2.0.47d that might be
involved?

Cheers,
Tim.
--
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: Dan Espen <[email-masked]>
Date: Tue, 21 Jul 1998 17:02:00 -0400

> AddToFunc my_resizeiconify
                             ^^^^^^^^^^^^^^^^^^

The missing command looks suspicious.

> +			"I" None [Iconic CurrentDesk] my_home
...problem not included.
> Any ideas what changed between 2.0.46 and 2.0.47d that might be

I haven't studied the problem, the bad command stood out.

--
Dan Espen                                Phone: (732) 699-5570
444 Hoes Lane  Room RRC 1C-214           E-mail: [email-masked]
Piscataway, NJ 08854
--
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: Tim Phipps <[email-masked]>
Date: Wed, 22 Jul 1998 13:08:29 +0100

> The missing command looks suspicious.

I tried it with the command on the same line as the AddToFunc and it
made no difference.  There really does seem to be a problem with Iconify
followed by Prev in which the Prev finds the iconified window even
though it shouldn't.  I expanded the functions to give the following
test:

AddToFunc my_resizeiconify "C" Current [!FvwmButtons] Iconify 1
+ "C" Prev [!Iconic CurrentDesk] Focus
+ "C" Prev [!Iconic CurrentDesk] Raise
+ "C" None [!Iconic CurrentDesk] Prev [Iconic CurrentDesk] Focus
+ "C" None [!Iconic CurrentDesk] Prev [Iconic CurrentDesk] Raise
+ "C" None [!Iconic CurrentDesk] None [Iconic CurrentDesk] Next
[FvwmButtons CirculateHit] Focus

When there is more than one window on the current desk this works fine. 
Lines 2 & 3 get executed and the focus moves. When there is just one
non-iconic window on the current desk lines 2 & 3 should get skipped and
lines 4, 5 & 6 should get executed.  This doesn't happen, instead the
focus is set to the window which was just iconified.  I don't know
wether the iconification happens or not, it is too fast.

The weird thing is that if the above function is called from a keypress
(with the "C"'s replaced with "I"'s) it works fine.  If called from a
mouse button with "I"'s instead of "C"'s the iconification happens but
the focus doesn't get moved.

My head hurts,
Tim.