Mouse offset when using java swing based gui applications

Richard Evans
Mon Jul 19 16:28:00 GMT 2010

I've attached a small test case which shows the menu problems.

Compile and run with:

java menus

My server configuration is Windows 7 x64, Cygwin/X X server version
1.7.3, with dual 1920x1200 monitors.  I ran the test case on Fedora 12
x86, using the latest released JRE 1.6u21.

The frame appears in one of two ways:

1. With the window frame off the screen top left - ie (0, 0) in the
content area is at (0, 0) on the display


2. With the window frame showing, but as soon as I try to select a menu,
the windows shifts to the position in 1.

When the frame as off screen, (as in 1. above), the menus work fine; If
I move the window elsewhere on the screen, the menus can be opened but
you can't select any item.

This menu behaviour has been seen for all versions of JDK 1.6 as far as
I remember; it certainly happens with 1.6u3 and 1.6u4.

Hope this helps


-----Original Message-----
From: Jon TURNEY [] 
Sent: 19 July 2010 16:52
To:;; Richard Evans
Subject: Re: Mouse offset when using java swing based gui applications

On 15/07/2010 15:38, Richard Evans wrote:
> There's a bug reported against Java relating to this, with some more
> details.  It claims to be fixed, but it still occurs.  There's a small
> test case in the bug report.  It makes many Java UI applications
> unusable with Cygwin/X.

Thanks very much for the link.  That bug report and related ones makes 
interesting reading: I can see now that Swing/AWT problems are probably
a few problem reports of this kind we've had.

I tried out the test case in that particular bug, and it does seem to be
in the JRE is claims to be fixed in.  But looking at the horror-show
that is [1], I can believe there are other problems, and the behaviour
be different with different JRE versions.

There's certainly scope for adding fixes/workarounds to the multiwindow
internal window manager so that AWT does the correct thing, but I guess
what I 
need to progress this is a test case I can easily run, and 'java
-version' for 
the platform the test case should be run on


Volunteer Cygwin/X X Server maintainer
-------------- next part --------------
A non-text attachment was scrubbed...
Type: application/octet-stream
Size: 984 bytes
URL: <>
-------------- next part --------------
Unsubscribe info:
Problem reports:

More information about the Cygwin-xfree mailing list