[NTUSER] Correctly store original unsnap position (#7244)

A small change before PR #5705 was merged caused a severe downgrade in the snap/unsnap handling. Win key handling should work correctly now.

CORE-19165 CORE-19166
This commit is contained in:
Whindmar Saksit 2024-08-15 12:33:17 +02:00 committed by GitHub
parent 7ede534910
commit 82a45262bf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View file

@ -3937,7 +3937,7 @@ co_IntSnapWindow(PWND Wnd, UINT Edge)
co_IntSendMessage(UserHMGetHandle(Wnd), WM_SYSCOMMAND, SC_MAXIMIZE, 0); co_IntSendMessage(UserHMGetHandle(Wnd), WM_SYSCOMMAND, SC_MAXIMIZE, 0);
return; return;
} }
else if (Edge) else if (Edge != HTNOWHERE)
{ {
UserRefObjectCo(Wnd, &ref); UserRefObjectCo(Wnd, &ref);
hasRef = TRUE; hasRef = TRUE;
@ -3951,7 +3951,7 @@ co_IntSnapWindow(PWND Wnd, UINT Edge)
IntSetSnapEdge(Wnd, HTNOWHERE); IntSetSnapEdge(Wnd, HTNOWHERE);
return; return;
} }
newPos = Wnd->InternalPos.NormalRect; newPos = Wnd->InternalPos.NormalRect; /* Copy RECT now before it is lost */
IntSetSnapInfo(Wnd, HTNOWHERE, NULL); IntSetSnapInfo(Wnd, HTNOWHERE, NULL);
} }
else else
@ -4000,7 +4000,7 @@ IntSetSnapInfo(PWND Wnd, UINT Edge, IN const RECT *Pos OPTIONAL)
{ {
RECT r; RECT r;
IntSetSnapEdge(Wnd, Edge); IntSetSnapEdge(Wnd, Edge);
if (Edge != HTNOWHERE) if (Edge == HTNOWHERE)
{ {
RECTL_vSetEmptyRect(&r); RECTL_vSetEmptyRect(&r);
Pos = (Wnd->style & WS_MINIMIZE) ? NULL : &r; Pos = (Wnd->style & WS_MINIMIZE) ? NULL : &r;

View file

@ -81,7 +81,7 @@ VOID FASTCALL IntSetSnapInfo(PWND Wnd, UINT Edge, IN const RECT *Pos OPTIONAL);
FORCEINLINE VOID FORCEINLINE VOID
co_IntUnsnapWindow(PWND Wnd) co_IntUnsnapWindow(PWND Wnd)
{ {
co_IntSnapWindow(Wnd, 0); co_IntSnapWindow(Wnd, HTNOWHERE);
} }
FORCEINLINE BOOLEAN FORCEINLINE BOOLEAN