JDK-5096679 : PIT:PrintDialog is not positioned properly on multi-mon, when coords are invalid
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 6
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: linux_redhat_9.0
  • CPU: x86
  • Submitted: 2004-09-03
  • Updated: 2016-03-23
  • Resolved: 2016-03-23
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.
Related Reports
Duplicate :  
Relates :  
Relates :  
Relates :  
I am calling ServiceUI.printDialog() to bring up the cross platform print dialog. The locations (x,y) are specified in such a way that it would make the print dialog go out of the screen. When I run this on a multi-monitor linux system having a virtual desktop, the print dialog is positioned exactly in between the 2 monitors, That is, half of it is shown on monitor1 and another half is shown on monitor2. It makes sense to display the dialog at the centre of the screen for a single monitor system when coords are invalid but it does not look good in case of multi-monitor systems. Either it can be made visible in the center of the first screen or the second one.

This is reproducible only on multi-screen systems running Linux. This is reproducible only on the PIT build. On earlier builds, the dialog appears at 0,0 location. Multi-Screen is configured using Xinerama, Matrox Millenium G450 DualHead - a video board having 2 outputs. This is tested on Linux RH 9. It has a virtual desktop where the entire desktop spans 2 monitors and you can move the windows from one screen to another.

I have attached a testcase. Execute the test on the above said configuration. If the dialog appears in between the 2 monitors, the bug is reproduced.

I think this is caused by the bug fix: 4929299: Service Dialog is not positioned properly if the coords are invalid, on win32.  

Here is the bounds of the 2 monitors:

graphics device [0] = X11GraphicsDevice[screen=0];
bounds = java.awt.Rectangle[x=0,y=0,width=1152,height=864]
graphics device [1] = X11GraphicsDevice[screen=1];
bounds = java.awt.Rectangle[x=1152,y=0,width=1152,height=864]

EVALUATION Looks like ServiceUI.printDialog() relies on window.setLocationRelativeTo() method for placing the dialog if the coordinates are invalid. There are few open bugs in setLocationRelativeTo() that is causing this behavior. Look into 'See Also' for more info. ###@###.### 2004-12-27 15:18:17 GMT