JBR-6920 Wayland: some IDEA popups positioned incorrectly

(cherry picked from commit e28d2bacc7)
This commit is contained in:
Maxim Kartashev
2024-04-02 20:00:41 +04:00
committed by jbrbot
parent 3f96f03ca5
commit 81298477c5
2 changed files with 6 additions and 3 deletions

View File

@@ -593,10 +593,10 @@ public class WLComponentPeer implements ComponentPeer {
try {
return WLRobotPeer.getLocationOfWLSurface(wlSurfacePtr);
} catch (UnsupportedOperationException ignore) {
return new Point(0, 0);
return new Point();
}
} else {
throw new UnsupportedOperationException("getLocationOnScreen() not supported without wayland surface");
return new Point();
}
}, Point::new);
}

View File

@@ -82,7 +82,10 @@ public abstract class WLGraphicsConfig extends GraphicsConfiguration {
@Override
public Rectangle getBounds() {
return new Rectangle(width, height);
// NB: despite the claims of GraphicsConfiguration.getBounds()'s javadoc,
// the value returned is expected to be in user-space coordinates,
// same as windows sizes, offsets, components' coordinates, etc.
return new Rectangle((int) (width / effectiveScale), (int) (height / effectiveScale));
}
/**