Re: user: test and fix SwitchToThisWindow [3rd try]
Jan Zerebecki <jan.wine(a)zerebecki.de> writes:
diff --git a/dlls/user/winpos.c b/dlls/user/winpos.c index 6bc9056..e78f484 100644 --- a/dlls/user/winpos.c +++ b/dlls/user/winpos.c @@ -152,7 +152,20 @@ UINT WINAPI ArrangeIconicWindows( HWND p */ void WINAPI SwitchToThisWindow( HWND hwnd, BOOL restore ) { - ShowWindow( hwnd, restore ? SW_RESTORE : SW_SHOWMINIMIZED ); + HWND hwndOld = GetForegroundWindow(); + SetActiveWindow( hwnd ); + SetForegroundWindow( hwnd ); + if ( restore ) + { + if ( IsIconic( hwnd ) ) + ShowWindow( hwnd, SW_RESTORE ); + } + else + { + if ( !( GetWindowLongW( hwndOld, GWL_EXSTYLE ) & WS_EX_TOPMOST ) ) + SetWindowPos( hwndOld, HWND_BOTTOM, 0, 0, 0, 0, + SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE ); + }
That HWND_BOTTOM thing looks very wrong, SwitchToThisWindow is supposed to move things to the front. Most likely your test case is flawed. -- Alexandre Julliard julliard(a)winehq.org
participants (1)
-
Alexandre Julliard