File tree Expand file tree Collapse file tree 1 file changed +13
-9
lines changed
src/java.desktop/unix/classes/sun/awt/X11 Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -892,18 +892,22 @@ private void resetScreenInsetsCache() {
892892
893893 @ Override
894894 public Insets getScreenInsets (final GraphicsConfiguration gc ) {
895- final X11GraphicsDevice device = (X11GraphicsDevice ) gc .getDevice ();
896- Insets insets = device .getInsets ();
897- if (insets == null ) {
898- synchronized (device ) {
899- insets = device .getInsets ();
900- if (insets == null ) {
901- insets = getScreenInsetsImpl (gc );
902- device .setInsets (insets );
895+ final GraphicsDevice gd = gc .getDevice ();
896+ if (gd instanceof X11GraphicsDevice x11Device ) {
897+ Insets insets = x11Device .getInsets ();
898+ if (insets == null ) {
899+ synchronized (x11Device ) {
900+ insets = x11Device .getInsets ();
901+ if (insets == null ) {
902+ insets = getScreenInsetsImpl (gc );
903+ x11Device .setInsets (insets );
904+ }
903905 }
904906 }
907+ return (Insets ) insets .clone ();
908+ } else {
909+ return super .getScreenInsets (gc );
905910 }
906- return (Insets ) insets .clone ();
907911 }
908912
909913 /*
You can’t perform that action at this time.
0 commit comments