Subject: FVWM: Invoking a menu for a window through a function

From: Marcus Lundblad <[email-masked]>
Date: Wed, 1 Jan 2003 12:51:25 +0100 (CET)

I have the following definitions

#   for the title bar buttons:
Mouse 0	1    	A      	Window-Menu-Func
Mouse 0	2    	A     	Maximize-and-Raise-toggle
Mouse 0	4    	A     	Iconify

and

AddToFunc	Window-Menu-Func
+	I	Current (HasHandles) Menu Window-Menu Interior 0 0 Close
+	I	Current (!HasHandles) Menu Window-Menu-No-Handles Interior 
0 0 Close

This works, but only for windows that can take focus. When clicking the
menu button on for example fvwm tear-off menus or xclock, nothing happens.

I also set
Style * Lenience

but this doesn't help.

Is it not possible to use Current to achive this?

//Marcus

--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].

---

From: Mikhael Goikhman <[email-masked]>
Date: Wed, 1 Jan 2003 12:22:20 +0000

> menu button on for example fvwm tear-off menus or xclock, nothing happens.

You probably use MouseFocus. With SloppyFocus you would not see
"nothing happens".

> Is it not possible to use Current to achive this?

Current works on the currently focused window, not on the pressed window.
All decoration/window based bindings are executed in the window context,
to use it there is ThisWindow conditional.

  ThisWindow (HasHandles) Menu Window-Menu Interior 0 0 Close

Regards,
Mikhael.

---

From: Marcus Lundblad <[email-masked]>
Date: Wed, 1 Jan 2003 14:13:19 +0100 (CET)

> You probably use MouseFocus. With SloppyFocus you would not see

Actually, when using ClickToFocus and Lenience, the FVWM tear-off menus
takes focus (when clicked).
Also

Next (HasPointer, HasHandles)
worked for xclock but not the tear-offs

>   ThisWindow (HasHandles) Menu Window-Menu Interior 0 0 Close

I changed to ThisWindow and it does what I had in mind.
Thanks.

Actually I have some vague plans for enhancing the syntax for menu
definitions to allow for example exclusion of items for windows matching
certain conditions. This would would eliminate the need for a hack like
this, having several similar definitions.

//Marcus