if I want to use the FVWMEvent::leave_window handler, does it get called every time a window is “left”, while keeping the $[w.name] variable with the value of the window that was just left?
e.g. – if I leave window Foo, and have the following code:
The above function will call FuncLeaveFoo everytime I leave a Foo, correct? The w.name variable doesn’t get overwritten by the new window name until this function has been ‘handled’ right?
A leaveEvent is generally triggered when the pointer leaves a window. This is different from a change in focus (more about this later.)
In this case it will, yes – for two reasons. One, you’ve actually told it to focus (that in itself will generate a focus event), and secondly, the WarpToWindow directive shifts the pointer – hence you’ll get a leave_window event.
Oh, I know that. Here’s what you had:
The problem with the above is that you aren’t echo’ing anything back to FVWM to interpret. The whole reason for using PipeRead is so that the shell can evaluate a condition, and return something back to FVWM. In fact, what you’ve written will work, if you insert an echo statement:
Of course, you’ll find yourself in a battle if you do this with your pointer. (Hint: You might be able to avoid this via the ‘PointerWindow’ command.) The question is perhaps more one of “how” do you plan on going from one window to the other? If it is via a key-binding, then doing something like:
PointerWindow (name_of_window) All (currentdesk,some_other_name) FlipFocus
… With the above, the FlipFocus will cause an enter_window event, and a focus_event. Adding ‘NoWarp’ to the end of that will just cause a focus_event — an interesting little tidbit for you.