JDK-8134669 : Empty screen insets in Gnome 3, OEL 7 in multiscreen mode
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 9
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2015-08-28
  • Updated: 2018-09-10
  • Resolved: 2016-03-24
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 9
9 b114Fixed
Related Reports
Relates :  
Relates :  
Description
Print the insets Toolkit.getDefaultToolkit().getScreenInsets(gc) on a machine with Gnome 3.  For instance, run (or slightly modify and run) the test java/awt/Multiscreen/MultiScreenInsetsTest/MultiScreenInsetsTest.java.
The test gets insets and screen bounds of all devices in turn and displays and maximizes a Frame on each of them.

I have OEL 7 (Gnome 3) with 2 monitors.

The first and default screen has top and bottom toolbars however the insets reported are always all 0s for all screens.
Note that maximized Frame does know about insets and has the correct size in both cases.

It is NOT true for single-screen configuration, however. 
It isn't true for Xfce4 w/o Xinerama.
Comments
I think the best we can do for OEL is to fall back to the single screen query if WM does not follow the specs. It will at least allow to return insets of the main screen, but other screens insets remain available.
08-10-2015

Sergey, unfortunately it is not possible for Xinerama unaware WMs. This information is available in Xinerama only. Native apps does not receive insets from WM as well. Why Java apps should be different?
07-10-2015

It cannot be considered as single monitor because we have more than one GraphicsDevice. The xinerama is a kind of virtual screen where each GraphicsDevice share the same coordinate system to form a combined virtual screen. I guess we should return correct insets for each GD.
06-10-2015

Hi Yuri, Actually, it is a single screen because Xinerama is on by default on OEL. Look what the getScreenSize () returns in multiscreen mode on OEL. The API doesn't allow to specify which mode to use for the getScreenInsets () the Xinerama window or individual screens. If Xinerama is on in the underling platform the root window is the joint desktop. So, I propose to close as not an issue. Any objections?
06-10-2015

What is exact OEL version you use? OEL 7.0 should be updated to 7.1 and all last updates need to be installed for it. Please try to run on the recent OS.
03-09-2015

RULE java/awt/Multiscreen/MultiScreenInsetsTest/MultiScreenInsetsTest.java Exception java.lang.RuntimeException: Test FAILED! Wrong screen #0 insets: java.awt.Insets[top=0,left=0,bottom=0,right=0]
28-08-2015