http://bugs.winehq.org/show_bug.cgi?id=9538
Summary: java: Component#getLocationOnScreen returning incorrect coords Product: Wine Version: CVS/GIT Platform: Other OS/Version: other Status: UNCONFIRMED Severity: normal Priority: P2 Component: wine-x11driver AssignedTo: wine-bugs@winehq.org ReportedBy: smckay@google.com CC: dank@kegel.com
Here's a short java program that behaves correctly on linux and windows, but not under wine. The program exercises a small part of the java awt toolkit.
1. Create a file with the following contents:
import java.awt.Component; import java.awt.Container; import java.awt.Frame; import java.awt.Point;
public class Bug {
public static void main(String[] args) { Frame f = new Frame(); Container cont = new Container(); Component comp = new Component(){}; f.add(cont); cont.add(comp); f.setSize(100, 100); f.setVisible(true); cont.setBounds(10, 10, 80, 80); comp.setBounds(10, 10, 60, 60);
Point frameLoc = f.getLocationOnScreen();
Point compLoc = comp.getLocationOnScreen();
// The component now should have // (frameLoc.x + 20 + i.left, frameLoc.y + 20 + i.top). System.out.printf("a.x=%d, a.y=%d / b.x=%d, b.y=%d\n", compLoc.x, compLoc.y, frameLoc.x, frameLoc.y);
f.dispose(); } }
2. Compile it:
javac Bug.java
3. Download a JDK from java.sun.com and install it in Wine
4. Use it to run Bug.class, e.g. cd '.wine/drive_c/Program Files/Java/jre1.6.0_01' cp ~/Bug.class . wine bin/java.exe Bug
5. Returns inconsistent results under wine. Under linux and windows it consistently returns "a.x=20, a.y=20 / b.x=0, b.y=0". Occasionally wine returns correct results, but repeated invocations of the application should produce inconsistent results (e.g. "a.x=16, a.y=-3 / b.x=-4, b.y=-23").
http://bugs.winehq.org/show_bug.cgi?id=9538
--- Comment #1 from Dan Kegel dank@kegel.com 2007-09-01 02:29:51 --- For the record, this is a reduced testcase extracted from the Mauve test suite.
http://bugs.winehq.org/show_bug.cgi?id=9538
Dan Kegel dank@kegel.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |INVALID
--- Comment #2 from Dan Kegel dank@kegel.com 2007-09-20 15:19:06 --- You left off the assertions from the original test case. I added them back in, and they pass. I'm not seeing the negative coordinates you were seeing; if you can reproduce those, perhaps you can file a new bug just for that.
http://bugs.winehq.org/show_bug.cgi?id=9538
--- Comment #3 from Dan Kegel dank@kegel.com 2007-09-20 15:19:51 --- Created an attachment (id=8159) --> (http://bugs.winehq.org/attachment.cgi?id=8159) Same test case with comment explaining where it came from, and with assertions added back in.
http://bugs.winehq.org/show_bug.cgi?id=9538
Dan Kegel dank@kegel.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #4 from Dan Kegel dank@kegel.com 2008-01-28 05:33:21 --- Closing all RESOLVED INVALID bugs that haven't changed in over three months.
http://bugs.winehq.org/show_bug.cgi?id=9538
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Version|CVS/GIT |unspecified