Subject: FVWM: Mouse Action behavior inconsistent with manual

From: "Tommy C. Li" <[email-masked]>
Date: Wed, 04 Aug 2004 15:21:53 -0700

Hello,

It's my perception that the mouse-triggered actions behave
inconsistently with what the manual says.

Specifically, actions don't seem to be triggered until a click is
completed - not on mouse-down - which is what is suggested by the manual.

Take for example this quote from the fvwm man page:

"The name must not contain embedded whitespace. No guarantees are made
whether function names with embedded whitespace work or not. This
behavior may also change in the future without further notice. The
letter before the action tells what kind of action triggers the command
which follows it. 'I' stands for "Immediate", and is executed as soon as
the function is invoked. 'M' stands for "Motion", i.e. if the user
starts moving the mouse. 'C' stands for "Click", i.e., if the user
presses and releases the mouse. 'H' stands for "Hold", i.e. if the user
presses a mouse button and holds it down for more than ClickTime
milliseconds. 'D' stands for "Double-click". The action 'I' causes an
action to be performed on the button-press, if the function is invoked
with prior knowledge of which window to act on."

This suggests that "Immediate" commands are executed on mouse-down,
while "Click" type is for press-and-release.

I've noticed that Immediate commands are only exceuted after release or
I press and move the pointer a bit. This is certainly not "Immediate" -
and there is a definite need for commands to be executed on mousedown.

In fact, for all mouse-bindings, actions are excuted on
click-and-release instead of mousedown. Key binding actions are executed
on mouse-down.

And also - there is this entry in the FvwmButtons manpage:

"ActionOnPress
~~    Usually the action is executed on the button release except for the
Popup action. This option changes this behavior, the action is executed
on the button press. This may be good, for example, with Menu or
SendToModule that generates popups, or when Frame is 0 and the button
would look unresponsive otherwise."

This suggests that popup actions are executed on mousedown. This is not
the case with buttons. They behave like "Immediate" commands - executing
only on mousedown+movement or mousedown+release.

If I add ActionOnPress, actions behave like "Immediate" commands again -
that is - not immediately!

Incidentally, popup menus only behave correctly in keybindings and
mousebindings on the Root Desktop.

Can anyone shed some light on this issue? It's a major annoyance.

--
Tommy C. Li                      |  RealityMage
Registered Linux User # 327563   |  http://www.impulsestorm.com
Gentoo Linux		         |  Kernel: 2.6.8-rc2-love1
--
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: Thu, 5 Aug 2004 01:18:29 +0000

On 04 Aug 2004 15:21:53 -0700, Tommy C. Li wrote:
> [...]
> [...]

This is strange, I can't reproduce any of these 2 problems, just tested.

Please create and post here a minimal fvwmrc file that has one function,
one problematic binding and a minimal FvwmButtons configuration opening
MenuFvwmRoot (this menu is globally defined).

Please always specify your fvwm version.

Regards,
Mikhael.

---

From: "Tommy C. Li" <[email-masked]>
Date: Wed, 04 Aug 2004 21:51:14 -0700

> Please always specify your fvwm version.

fvwm-2.5.10-r6 is what I'm using.

This is an example of what doesn't work:

*module-buttons-applist: (1x1, Icon MiniIcon, ActionOnPress, Action
(Mouse 1) WindowList NoGeometry NoDeskNum MaxLabelWidth 50 NoIcons)

The plot thickens: When any modifier is pressed, including NumLock,
everything functions exactly as the manual says.

---

From: Dominik Vogt <[email-masked]>
Date: Thu, 5 Aug 2004 03:12:52 +0200

> while "Click" type is for press-and-release.

And it is exactly what fvwm does.  With

  AddToFunc immediate I echo immediate
  mouse 3 r n function immediate

the "echo immediate" is executed as soon the button is pressed,
and with 

  AddToFunc click C echo click
  mouse 3 r n function click

There are a couple of exception, though:

 - If an application is started that tries to grab control of the
   pointer, it will succeed only after the function is completed.
 - Commands that change the window focus do change the foucs
   immediately, but the window decorations are redrawn only after
   the function completes.  Fvwm tracks the focused window by the
   corresponding X event, and events are not handled during
   function execution.  Hence the delay.
 - To suppress excessive redrawing, changes in window styles are
   activated only after the function completes and fvwm is idle
   (i.e. not receiving events or module input).
 - If a command needs a window to operate on, and no window has
   been selected yet, you have to release the button first and
   then click on a window.

Note that the function itself only completes when the last mouse
button is released.

> would look unresponsive otherwise."

Works as advertised for me.

> Can anyone shed some light on this issue? It's a major annoyance.

Is there any chance your mouse or your X server is broken?  When
fvwm receives a ButtonPress event it acts immediately.

Ciao

Dominik ^_^  ^_^

 --
Dominik Vogt, [email-masked]
Reply-To: [email-masked]

---

From: "Tommy C. Li" <[email-masked]>
Date: Thu, 05 Aug 2004 14:14:08 -0700

> Can anyone shed some light on this issue? It's a major annoyance.

I now realize that it's somewhere within my configuration files that is causing 
this. The Sample95 configuration does not have this behavior.

My configuration files are based on fvwm-crystal. Any idea about what settings 
could cause this glitch?

---

From: Thomas Adam <[email-masked]>
Date: Thu, 5 Aug 2004 22:18:05 +0100

On Thu, 05 Aug 2004 14:14:08 -0700
"Tommy C. Li" <[email-masked]> wrote:
 
> My configuration files are based on fvwm-crystal. Any idea about what
> settings could cause this glitch?

Not without seeing them, no.

-- Thomas Adam

--
"Frankly, Mr. Shankly, since you ask. You are a flatulent pain in the
arse." -- Morrissey.

---

From: "Tommy C. Li" <[email-masked]>
Date: Thu, 05 Aug 2004 11:39:39 -0700

Dominik Vogt wrote:
| On Wed, Aug 04, 2004 at 03:21:53PM -0700, Tommy C. Li wrote:
|
|>Hello,
|>
|>It's my perception that the mouse-triggered actions behave
|>inconsistently with what the manual says.
|>
|>Specifically, actions don't seem to be triggered until a click is
|>completed - not on mouse-down - which is what is suggested by the manual.
|>
|>Take for example this quote from the fvwm man page:
|>
|>"The name must not contain embedded whitespace. No guarantees are made
|>whether function names with embedded whitespace work or not. This
|>behavior may also change in the future without further notice. The
|>letter before the action tells what kind of action triggers the command
|>which follows it. 'I' stands for "Immediate", and is executed as soon as
|>the function is invoked. 'M' stands for "Motion", i.e. if the user
|>starts moving the mouse. 'C' stands for "Click", i.e., if the user
|>presses and releases the mouse. 'H' stands for "Hold", i.e. if the user
|>presses a mouse button and holds it down for more than ClickTime
|>milliseconds. 'D' stands for "Double-click". The action 'I' causes an
|>action to be performed on the button-press, if the function is invoked
|>with prior knowledge of which window to act on."
|
|
|
|>This suggests that "Immediate" commands are executed on mouse-down,
|>while "Click" type is for press-and-release.
|
|
| And it is exactly what fvwm does.  With
|
|   AddToFunc immediate I echo immediate
|   mouse 3 r n function immediate
|
| the "echo immediate" is executed as soon the button is pressed,
| and with
|
|   AddToFunc click C echo click
|   mouse 3 r n function click
|
| There are a couple of exception, though:
|
|  - If an application is started that tries to grab control of the
|    pointer, it will succeed only after the function is completed.
|  - Commands that change the window focus do change the foucs
|    immediately, but the window decorations are redrawn only after
|    the function completes.  Fvwm tracks the focused window by the
|    corresponding X event, and events are not handled during
|    function execution.  Hence the delay.
|  - To suppress excessive redrawing, changes in window styles are
|    activated only after the function completes and fvwm is idle
|    (i.e. not receiving events or module input).
|  - If a command needs a window to operate on, and no window has
|    been selected yet, you have to release the button first and
|    then click on a window.
|
| Note that the function itself only completes when the last mouse
| button is released.
|
|
|>I've noticed that Immediate commands are only exceuted after release or
|>I press and move the pointer a bit. This is certainly not "Immediate" -
|>and there is a definite need for commands to be executed on mousedown.
|>
|>In fact, for all mouse-bindings, actions are excuted on
|>click-and-release instead of mousedown. Key binding actions are executed
|>on mouse-down.
|
|
|>And also - there is this entry in the FvwmButtons manpage:
|>
|>"ActionOnPress
|>~~    Usually the action is executed on the button release except for the
|>Popup action. This option changes this behavior, the action is executed
|>on the button press. This may be good, for example, with Menu or
|>SendToModule that generates popups, or when Frame is 0 and the button
|>would look unresponsive otherwise."
|
|
| Works as advertised for me.
|
|
|>This suggests that popup actions are executed on mousedown. This is not
|>the case with buttons. They behave like "Immediate" commands - executing
|>only on mousedown+movement or mousedown+release.
|>
|>If I add ActionOnPress, actions behave like "Immediate" commands again -
|>that is - not immediately!
|>
|>Incidentally, popup menus only behave correctly in keybindings and
|>mousebindings on the Root Desktop.
|>
|>Can anyone shed some light on this issue? It's a major annoyance.
|
|
| Is there any chance your mouse or your X server is broken?  When
| fvwm receives a ButtonPress event it acts immediately.
|
| Ciao
|
| Dominik ^_^  ^_^
|
|  --
| Dominik Vogt, [email-masked]
| Reply-To: [email-masked]

Nope - I still get my old behavior. And I don't think I have anything wrong with
my X-server.

I use x11-base/xorg-x11-6.7.0-r2