Module: wine Branch: master Commit: f271634296a952a7e0efdf8a7fe474e67367c7e5 URL: http://source.winehq.org/git/wine.git/?a=commit;h=f271634296a952a7e0efdf8a7f...
Author: Drew Ronneberg drew_ronneberg@yahoo.com Date: Tue Nov 18 22:30:37 2014 -0500
user32: Do not call SendMessage() to hide a window that is already hidden.
---
dlls/user32/tests/msg.c | 3 --- dlls/user32/winpos.c | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c index d829c5f..28bb35e 100644 --- a/dlls/user32/tests/msg.c +++ b/dlls/user32/tests/msg.c @@ -4673,8 +4673,6 @@ static void test_messages(void) flush_events(); ok_sequence(WmEmptySeq, "ShowWindow(SW_HIDE):overlapped", FALSE);
- if (0) - { /* test ShowWindow(SW_HIDE) on a hidden window - multi-threaded */ hthread = CreateThread(NULL, 0, show_window_thread, hwnd, 0, &tid); ok(hthread != NULL, "CreateThread failed, error %d\n", GetLastError()); @@ -4682,7 +4680,6 @@ static void test_messages(void) CloseHandle(hthread); flush_events(); ok_sequence(WmEmptySeq, "ShowWindow(SW_HIDE):overlapped", FALSE); - }
ShowWindow(hwnd, SW_SHOW); flush_events(); diff --git a/dlls/user32/winpos.c b/dlls/user32/winpos.c index 5373733..12d3ffa 100644 --- a/dlls/user32/winpos.c +++ b/dlls/user32/winpos.c @@ -1219,6 +1219,9 @@ BOOL WINAPI ShowWindow( HWND hwnd, INT cmd ) if ((full_handle = WIN_IsCurrentThread( hwnd ))) return show_window( full_handle, cmd );
+ if ((cmd == SW_HIDE) && !(GetWindowLongW( hwnd, GWL_STYLE ) & WS_VISIBLE)) + return FALSE; + return SendMessageW( hwnd, WM_WINE_SHOWWINDOW, cmd, 0 ); }