mirror of
https://github.com/JetBrains/JetBrainsRuntime.git
synced 2025-12-06 09:29:38 +01:00
IDEA-172422 Popup at the wrong place on the second monitor (new hidpi)
Adopted: moved to AwtWindow::Reshape
(cherry picked from commit 11a0911d65)
This commit is contained in:
committed by
Vitaly Provodin
parent
acedb2b62f
commit
9900fe019a
@@ -1233,8 +1233,16 @@ void AwtWindow::Reshape(int x, int y, int w, int h) {
|
||||
VERIFY(::GetWindowRect(parent->GetHWnd(), &rect));
|
||||
int xOffset = /*ceil'd*/device->ScaleUpAbsX(device->ScaleDownAbsX(rect.left)) - rect.left;
|
||||
int yOffset = /*ceil'd*/device->ScaleUpAbsY(device->ScaleDownAbsY(rect.top)) - rect.top;
|
||||
scaleUpAbsX -= xOffset;
|
||||
scaleUpAbsY -= yOffset;
|
||||
int newX = scaleUpAbsX - xOffset;
|
||||
int newY = scaleUpAbsY - yOffset;
|
||||
|
||||
// Check the toplevel is not going to be moved to another screen.
|
||||
::SetRect(&rect, newX, newY, newX + w, newY + h);
|
||||
HMONITOR hmon = ::MonitorFromRect(&rect, MONITOR_DEFAULTTONEAREST);
|
||||
if (hmon != NULL && AwtWin32GraphicsDevice::GetScreenFromHMONITOR(hmon) == device->GetDeviceIndex()) {
|
||||
scaleUpAbsX = newX;
|
||||
scaleUpAbsY = newY;
|
||||
}
|
||||
}
|
||||
|
||||
ReshapeNoScale(scaleUpAbsX, scaleUpAbsY, ScaleUpX(w), ScaleUpY(h));
|
||||
|
||||
Reference in New Issue
Block a user