On Fri, Jan 25, 2002 at 09:25:51PM -0500, Ben Logan wrote:
> Hello,
>
> I have recently switched to FVWM2, and am a fan so far. I like the
> ability to configure practically everything.
>
> I often run an X-session over VNC (server and client both run on Linux
> machines), and would like for FVWM to ignore all of my key/mouse
> events when the mouse is over (or focus is on) the VNC client's
> window. IOW, I want FVWM to pass those events on to the window,
> usually because I want the FVWM running over VNC to receive them.
>
> Is there any way to accomplish this?
Yes, but not easily. Most bindings are somewhere in your
.fvwm2rc, e.g.
mouse 1 t n move
key f1 a m foobar
...
and some are found in the ConfigFvwmDefaults file that comes with
fvwm.
If you put all of them in one fvwm function and the commands to
disable them in another, you can switch the bindings on an off
when the pointer enters the VNC window with FvwmAuto or
FvwmEvent. It's a bit difficult to get this right. You don't
want to re-add the bindings every time the focus changes because
it costs a lot of time. This is what I finally came up with:
--------------------------- snip --------------------------
DestroyFunc activate_bindings
DestroyFunc remove_bindings
DestroyFunc do_activate_bindings
DestroyFunc do_remove_bindings
AddToFunc AddAllBindings
+ I Mouse 1 T A Function MoveOrRaise
AddToFunc RemoveAllBindings
+ I Mouse 1 T A beep
AddToFunc activate_bindings
+ I Function do_activate_bindings
+ I DestroyFunc do_activate_bindings
+ I DestroyFunc do_remove_bindings
+ I AddToFunc do_remove_bindings I Function RemoveAllBindings
AddToFunc remove_bindings
+ I Function do_remove_bindings
+ I DestroyFunc do_activate_bindings
+ I DestroyFunc do_activate_bindings
+ I AddToFunc do_activate_bindings I Function AddAllBindings
AddTofunc focus_change_event
+ I WindowId $0 (FvwmConsole) Function remove_bindings
+ I WindowId $0 (!FvwmConsole) Function activate_bindings
AddToFunc do_remove_bindings
+ I Function RemoveAllBindings
AddToFunc StartFunction
+ I AddAllBindings
+ I Module FvwmEvent
AddToFunc EnterEvent
+ I WindowId $0 (!raised) Raise
*FvwmEvent: PassId
*FvwmEvent: focus_change "Silent focus_change_event"
Style FvwmConsole MouseFocus, MouseFocusClickRaisesOff
--------------------------- snip --------------------------
This example works with FvwmConsole. You'll have to replace that
with the VNC window's unique name or resource. I think this works
best with MouseFocus, so I set this explicitly at the end. The
AddAllBindings and RemoveAllBindings should contain all key
bindings and all mouse bindings that work on the client window.
You can leave mouse bindings on the title, buttons, border or the
root window activated all the time.
Unfortunately that does not work with any released version. I
discovered a bug that caused infinite focus_change events while
the pointer was over the FvwmConsole window. You can either
download tomorrow's snapshot or wait for the 2.5.0 release.
Bye
Dominik ^_^ ^_^
--
Dominik Vogt, dominik.vogt_at_gmx.de
Reply-To: dominik.vogt_at_gmx.de
--
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 majordomo_at_fvwm.org.
To report problems, send mail to fvwm-owner_at_fvwm.org.
Received on Sun Jan 27 2002 - 09:43:44 GMT