From 114899a9dece61078a420b65ce3078e2edb14e68 Mon Sep 17 00:00:00 2001 From: NF Stevens Date: Sat, 30 Jan 1999 15:49:51 +0000 Subject: [PATCH] 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. --- windows/winpos.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/windows/winpos.c b/windows/winpos.c index 33b191bb760..2fb256b99a6 100644 --- a/windows/winpos.c +++ b/windows/winpos.c @@ -1121,6 +1121,11 @@ BOOL32 WINAPI ShowWindow32( HWND32 hwnd, INT32 cmd ) if (!wasVisible) return FALSE; swp |= SWP_HIDEWINDOW | SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOZORDER; + if ((hwnd == GetFocus32()) || IsChild32( hwnd, GetFocus32())) + { + /* Revert focus to parent */ + SetFocus32( GetParent32(hwnd) ); + } break; case SW_SHOWMINNOACTIVE: @@ -2384,12 +2389,6 @@ BOOL32 WINAPI SetWindowPos32( HWND32 hwnd, HWND32 hwndInsertAfter, 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 (winpos.hwnd == hwndActive)