This is the mail archive of the cygwin-xfree mailing list for the Cygwin XFree86 project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Automatically positioned mouse movements are off target


I installed Cygwin/X (latest version, according to the Cygwin installer) on
my laptop. I use Putty with X11 forwarding to connect to a Red Hat Linux
system. I start the X windows server on my laptop using startxwin.bat as
installed. After logging in to the Red Hat system, I execute gnome-session&,
and the gnome desktop shows on my Windows desktop. So far, so good.

I am testing a Java application using a tool called Abbot. Abbot launches
your Java Swing app within Abbot?s JVM. Abbot reads the coordinates of Swing
components from internal Java objects, and then issues mouse and keystroke
commands to simulate user actions according to a script.

My observation is that the mouse clicks are off target. Specifically, Abbot
is aiming to hit the exact center of each component, but it misses either
high or low. (Left and right centering seem fine.)

The amount of the miss has something to do with my Task Bar. When the
Windows Task Bar is locked at top, then the clicks miss below (i.e., lower
on the screen) the intended component. When the Task Bar is docked to the
right, left, or bottom, or if it is at the top and set to auto-hide then
mouse clicks miss above the intended component.

I have verified that this issue is not related to Java Look & Feel: I tested
the Metal, Motif, and GTK options, and all Looks & Feels behaved the same.

I tested starting XWin with ?rootless, -nodecoration, -swcursor, and
?fullscreen. These did not seem to make a difference.

Thinking that the issue might be in Abbot, I posted the question to the
Abbot-users mailing list. The reply from Abbot?s principal developer is
appended.

The developer gave me a task (to use java.awt.Robot to click at known
positions), which I have not carried out as such. It seemed like there was a
simpler way to isolate the problem.

I verified that manual mouse clicks activate the right controls. That is, if
I place the mouse over a pixel right on the border of a component, and then
click, then the click does stimulate the right component. This lends some
support to his theory that the problem occurs in automating the positioning
the mouse, since manual positioning works fine.

While carrying out this test, I noticed another anomaly. There is a text box
on the screen, and the mouse cursor should change to the ?Text? cursor (the
I-beam) when hovering over that component. The cursor does change to an
I-beam, but it occurs when hovering over a rectangle that is above the
component.

Thanks,
Brian


>> Is Abbot incorrectly calculating the position of components in this 
>> configuration?

>Abbot uses AWT/Swing methods to determine the absolute position of a
component on the screen.

>It's more likely that Java running under X11 is getting incorrect
information from the X Server on your Windows box, which is in turn
confusing the Abbot operations.? It's also possible that the X Server's
XTEST extension (which is what java.awt.Robot uses to generate events) has
bugs.

>Position a window at several known locations and use java.awt.Robot to
click at absolute positions.? If the resulting events occur exactly where
you sent them, then the bug is in the abbot library.? If not, the bug is in
the X Server XTEST implementation or in the information being provided the X
Client (java in this case) by your Windows X server.



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://x.cygwin.com/docs/
FAQ:                   http://x.cygwin.com/docs/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]