JDK-7009114 : GTK FileDialog lies about it's Bounds
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 7
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: linux
  • CPU: generic
  • Submitted: 2010-12-27
  • Updated: 2011-04-07
  • Resolved: 2011-04-07
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7
7 b134Fixed
Related Reports
Relates :  
Relates :  
Description
Run a small attached test on a Gnome or other GTK-based window manager.

GTK FileDialog will appear. A separate thread will try to query and set location/bounds of the dialog. Apparently a window manager will ignore attempts to position the dialog: let's think it's OK for now. However when we ask about location and size of the dialog, it lies.
First, it does falsely report 0,0 (or whatever was set before show) as the location and then does report the location and size as if our unsuccessful attempt to change them has been successful. 

It seems that the property in java was changed and retained without regard of success or failure of a setter.

Comments
EVALUATION In this particular CR, we're going to implement support for the setBounds methods in the GTK's implementation of the AWT's file dialogs. At the same time, the fix doesn't address the following things: 1. It doesn't address the same functionality on MS Windows platforms. That is it's not possible to place the AWT's file dialogs at an arbitrary location on MS Windows. The following existing CR covers the missing functionalities: http://monaco.sfbay.sun.com/detail.jsf?cr=6179142 2. The fix implements the setBounds method for the GTK's implementation but there're other "inherited" functionality that are still missing and requires significant time/effort to support it in the GTK's implementation. Please also note that one of the limitations of the current fix is: if a user moves/resizes the file dialog with mouse, then the file dialog will still report incorrect results when calling the getX/getY/getWidth/getHeight methods. The puspose of the current fix is to avoid massive failures on the tests for GTK's file dialogs (GTK's implementation is default starting from the recent JDK7 builds).
25-02-2011

SUGGESTED FIX http://sa.sfbay.sun.com/projects/awt_data/7/7009114/
25-02-2011

EVALUATION It also should happen on windows and the dialog appears in the top-left screen corner.
30-12-2010