FVWM: JAVA appearing off-screen work around

From: John Latham <jtl_at_cs.man.ac.uk>
Date: Tue, 10 Sep 2002 17:32:56 +0100

I've been working on a 4th JAVA work around, for the ``appearing off the
top-left corner'' problem.

DestroyFunc ToggleJAVAFvwmEventAWTConfigureWindowMoveOnScreenOn
AddToFunc ToggleJAVAFvwmEventAWTConfigureWindowMoveOnScreenOn
+ "I" *JAVAFvwmEventMoveOnScreenAWT: Cmd Function
+ "I" *JAVAFvwmEventMoveOnScreenAWT: PassID
+ "I" *JAVAFvwmEventMoveOnScreenAWT: configure_window MoveOnScreenGivenWindowIfAWT
+ "I" Module FvwmEvent JAVAFvwmEventMoveOnScreenAWT
+ "I" All Function MoveOnScreenGivenWindowIfAWT $w

# This is for 2.4.x so need PipeRead to do the geometry comparison
# Or is there another way?
DestroyFunc MoveOnScreenGivenWindowIfAWT
AddToFunc MoveOnScreenGivenWindowIfAWT
+ "I" WindowId $0 (AWTapp,Visible) PipeRead "test $[w.x] -lt 0 -o $[w.y] -lt 0 && echo ThisWindow Move 0 0"
+ "I" WindowId $0 (AWTdialog,Visible) PipeRead "test $[w.x] -lt 0 -o $[w.y] -lt 0 && echo ThisWindow Move 0 0"

DestroyFunc ToggleJAVAFvwmEventAWTConfigureWindowMoveOnScreenOff
AddToFunc ToggleJAVAFvwmEventAWTConfigureWindowMoveOnScreenOff
+ "I" KillModule FvwmEvent JAVAFvwmEventMoveOnScreenAWT
+ "I" DestroyModuleConfig JAVAFvwmEventMoveOnScreenAWT*

However, on 2.4.9 (as opposed to 2.5.3) this gives rise to an annoying
problem. Suppose we are running a Java program that is frequently
reconfiguring itself (e.g. it is adding new components and repacking) and we
have enabled this workaround so that it does not creep off the screen. This
means that, due to FVWM grabbing the mouse while complex functions are
executed, any mouse clicks *anywhere* are liable to be received by FVWM. So,
you might click on a FvwmButton somewhere, or on a menu item in the Java
program, and some of your clicks will be got by FVWM and will pop up your root
window menu!

In 2.5.x, these clicks seem to be ignored -- which is safer. But in 2.4.x they
are acted upon -- horribly.

Is this difference deliberate? If so, would it be easy to add the ``throw away
mouse clicks during complex functions'' feature to 2.4.x?

                ----------------------------------------------

I have tried a work around, using envrionment variables to disable the root
mouse bindings:

DestroyFunc MoveOnScreenGivenWindowIfAWT
AddToFunc MoveOnScreenGivenWindowIfAWT
+ "I" SetEnv FVWMMenuOrNop Nop
+ "I" SetEnv FVWMWindowListOrNop Nop
+ "I" WindowId $0 (AWTapp,Visible) PipeRead "test $[w.x] -lt 0 -o $[w.y] -lt 0 && echo ThisWindow Move 0 0"
+ "I" WindowId $0 (AWTdialog,Visible) PipeRead "test $[w.x] -lt 0 -o $[w.y] -lt 0 && echo ThisWindow Move 0 0"
+ "I" SetEnv FVWMMenuOrNop Menu
+ "I" SetEnv FVWMWindowListOrNop WindowList

with my root menu bindings as:

SetEnv FVWMMenuOrNop Menu
SetEnv FVWMWindowListOrNop WindowList
Mouse 1 R A $$[FVWMMenuOrNop] StartMenu Nop
Mouse 2 R A $$[FVWMWindowListOrNop] Alphabetic
Mouse 3 R A $$[FVWMMenuOrNop] AUTO_WM_CONFIG Nop


I have the *impression* this helps a bit, but it is far from foolproof. Any
suggestions?

Best wishes, John Latham
--
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 Tue Sep 10 2002 - 11:33:51 BST

This archive was generated by hypermail 2.3.0 : Mon Aug 29 2016 - 19:37:53 BST