In Window SetWindowPos with SWP_HIDEWINDOW does not remove
the focus from the focus window; ShowWindow with SW_HIDE does. So move the code that does this from SetWindowPos to ShowWindow.
This commit is contained in:
parent
a6af1f76a8
commit
114899a9de
|
@ -1121,6 +1121,11 @@ BOOL32 WINAPI ShowWindow32( HWND32 hwnd, INT32 cmd )
|
||||||
if (!wasVisible) return FALSE;
|
if (!wasVisible) return FALSE;
|
||||||
swp |= SWP_HIDEWINDOW | SWP_NOSIZE | SWP_NOMOVE |
|
swp |= SWP_HIDEWINDOW | SWP_NOSIZE | SWP_NOMOVE |
|
||||||
SWP_NOACTIVATE | SWP_NOZORDER;
|
SWP_NOACTIVATE | SWP_NOZORDER;
|
||||||
|
if ((hwnd == GetFocus32()) || IsChild32( hwnd, GetFocus32()))
|
||||||
|
{
|
||||||
|
/* Revert focus to parent */
|
||||||
|
SetFocus32( GetParent32(hwnd) );
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SW_SHOWMINNOACTIVE:
|
case SW_SHOWMINNOACTIVE:
|
||||||
|
@ -2384,12 +2389,6 @@ BOOL32 WINAPI SetWindowPos32( HWND32 hwnd, HWND32 hwndInsertAfter,
|
||||||
uFlags |= SMC_NOPARENTERASE;
|
uFlags |= SMC_NOPARENTERASE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((winpos.hwnd == GetFocus32()) ||
|
|
||||||
IsChild32( winpos.hwnd, GetFocus32()))
|
|
||||||
{
|
|
||||||
/* Revert focus to parent */
|
|
||||||
SetFocus32( GetParent32(winpos.hwnd) );
|
|
||||||
}
|
|
||||||
if (hwnd == CARET_GetHwnd()) DestroyCaret32();
|
if (hwnd == CARET_GetHwnd()) DestroyCaret32();
|
||||||
|
|
||||||
if (winpos.hwnd == hwndActive)
|
if (winpos.hwnd == hwndActive)
|
||||||
|
|
Loading…
Reference in New Issue