Skip to content

Commit 287d033

Browse files
mkartashevjbrbot
authored and
jbrbot
committed
JBR-7749 Settings popup invoked from the main toolbar appears misaligned if fractional scaling set
1 parent 49fd10c commit 287d033

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/java.desktop/unix/classes/sun/awt/X11/XToolkit.java

+5-6
Original file line numberDiff line numberDiff line change
@@ -1244,15 +1244,14 @@ private Insets getScreenInsetsImpl(final GraphicsConfiguration gc) {
12441244
if (np == null || !(gd instanceof X11GraphicsDevice) || !np.active()) {
12451245
return super.getScreenInsets(gc);
12461246
}
1247+
final GraphicsDevice[] devices = ((X11GraphicsEnvironment)GraphicsEnvironment.
1248+
getLocalGraphicsEnvironment()).getScreenDevices();
1249+
if (localEnv.runningXinerama() && devices.length > 1) {
1250+
return new Insets(0, 0, 0, 0);
1251+
}
12471252
X11GraphicsDevice x11gd = (X11GraphicsDevice) gd;
12481253
int screenNum = x11gd.getScreen();
12491254
Rectangle screen = gc.getBounds();
1250-
boolean isFirstScreen = screen.x == 0 && screen.y == 0;
1251-
if (localEnv.runningXinerama() && !isFirstScreen) {
1252-
// We cannot estimate insets for non-default screen,
1253-
// there are often none.
1254-
return new Insets(0, 0, 0, 0);
1255-
}
12561255

12571256
XToolkit.awtLock();
12581257
try {

0 commit comments

Comments
 (0)