[Bug 1110138] Re: Unity: wrong window dimensions / location in Java applications
Sharcoux
darksharcoux at hotmail.com
Mon Jun 15 03:53:18 UTC 2015
I also face the bug. I think that the discussion made at
http://stackoverflow.com/questions/30836201/jframe-wrong-location-with-
ubuntu-unity can help understand and track the bug. The issue is that
the behaviour is random. See my edit to detect when it happens.
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to openjdk-7 in Ubuntu.
https://bugs.launchpad.net/bugs/1110138
Title:
Unity: wrong window dimensions / location in Java applications
Status in Compiz:
Fix Released
Status in Compiz 0.9.9 series:
Fix Released
Status in Java OpenStreetMap editor:
Unknown
Status in compiz package in Ubuntu:
Fix Released
Status in openjdk-7 package in Ubuntu:
Confirmed
Bug description:
In Java applications, the functions to set and get window dimensions
and position do not work as expected. This problem is only observed in
Unity but not gnome, Win., etc.
Details:
* Call setSize(200, 200) and setLocation(300,400) for a JDialog
object.
* If you call getSize() and getLocation() directly after making the
JDialog visible, the result will be (200,200) and (300,400). Calling
getSize() and getLocation() again, a split second later, the result is
now (200,200) and (301,428). In both cases, the values are wrong, the
size and location is actually (202,229) and (300,400) as shown by a
screen capture.
Consequences:
* If the dialog is designed to reach to the bottom of the screen, the
lower end will be cut off about 30 pixel, so the window needs to be
moved by the user each time to see the lower button row (e.g. settings
dialog in netbeans on medium resolution screen).
* In applications that save and restore window position and size, the
window will move down 28 pixel each time it is opened an closed (e.g.
JOSM, preference dialog).
Expected behavior:
* The result of getLocation() should be constant for one window unless
the user moves the window
* setSize(dx,dy) should not set the size of the content pane, but the
size of the entire window, including window decorations
* be consistent for all Window objects, e.g. in the attached sample,
the JFrame works correctly, but the JDialog shows the described bug
Output of the sample code (press button "click", then press button
"click2"):
dlg.getLocationOnScreen()=java.awt.Point[x=300,y=400]
dlg.getLocationOnScreen()=java.awt.Point[x=301,y=428]
Note: Both getLocation() and getLocationOnScreen() return the same
values.
Observed for the following Java versions:
java version "1.6.0_24"
OpenJDK Runtime Environment (IcedTea6 1.11.5) (6b24-1.11.5-0ubuntu1~12.10.1)
OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)
and
java version "1.7.0_09"
OpenJDK Runtime Environment (IcedTea7 2.3.4) (7u9-2.3.4-0ubuntu1.12.10.1)
OpenJDK 64-Bit Server VM (build 23.2-b09, mixed mode)
Ubuntu 12.10
unity-6.12.0-0ubuntu0.2
update: same behavior in gnome classic with compiz running
To manage notifications about this bug go to:
https://bugs.launchpad.net/compiz/+bug/1110138/+subscriptions
More information about the foundations-bugs
mailing list