8301616: Drag & maximize to another monitor places window incorrectly (Windows)
Reviewed-by: avu, aivanov, serb
This commit is contained in:
parent
a3137c750f
commit
f69d88c57f
@ -371,6 +371,20 @@ void AwtWindow::RepositionSecurityWarning(JNIEnv *env)
|
||||
MsgRouting AwtWindow::WmWindowPosChanged(LPARAM windowPos) {
|
||||
WINDOWPOS * wp = (WINDOWPOS *)windowPos;
|
||||
|
||||
// There's no good way to detect partial maximization (e.g. Aero Snap),
|
||||
// but by inspecting SWP_* flags we can guess it and reset
|
||||
// prevScaleRec to neutralize the CheckWindowDPIChange logic.
|
||||
// Here are the flags, observed on Windows 11 for reference:
|
||||
// Restore/maximize: SWP_NOZORDER | SWP_DRAWFRAME
|
||||
// Partial Aero Snap: SWP_NOZORDER | SWP_NOREPOSITION
|
||||
// DPI change (new screen): SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOCOPYBITS
|
||||
if (!(wp->flags & (SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE)) &&
|
||||
prevScaleRec.screen != -1 && prevScaleRec.screen != m_screenNum) {
|
||||
prevScaleRec.screen = -1;
|
||||
prevScaleRec.scaleX = -1.0f;
|
||||
prevScaleRec.scaleY = -1.0f;
|
||||
}
|
||||
|
||||
// Reposition the warning window
|
||||
if (IsUntrusted() && warningWindow != NULL) {
|
||||
if (wp->flags & SWP_HIDEWINDOW) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user