diff --git a/README.md b/README.md index eb1cd655..3dbea009 100644 --- a/README.md +++ b/README.md @@ -39,9 +39,10 @@ Wine. All those differences are also documented on the Included bug fixes and improvements =================================== -**Bugfixes and features included in the next upcoming release [2]:** +**Bugfixes and features included in the next upcoming release [3]:** * Implement exclusive mode in PulseAudio backend ([Wine Bug #37042](https://bugs.winehq.org/show_bug.cgi?id=37042)) +* ShowWindow should avoid interthread no-op messages ([Wine Bug #11582](https://bugs.winehq.org/show_bug.cgi?id=11582)) * Take abs() of vertex z coordinate as FFP fog coordinate diff --git a/debian/changelog b/debian/changelog index f1b4f2d8..3411583b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,6 +3,7 @@ wine-compholio (1.7.32) UNRELEASED; urgency=low * Added patch to ensure dbghelp always checks for debug symbols in BINDIR. * Added patch for pulseaudio exclusive mode support. * Added patch to take abs() of vertex z coordinate as FFP fog coordinate. + * Added patch to ensure ShowWindow avoids interthread no-op messages. * Removed patch to close server fd is there is no space in thread inflight fd list (accepted upstream). * Removed patch to fix bugs in StrStr functions (accepted upstream). * Removed patches to avoid sending messages in FindWindowExW (accepted upstream). diff --git a/patches/Makefile b/patches/Makefile index 2258eaab..432085f5 100644 --- a/patches/Makefile +++ b/patches/Makefile @@ -100,6 +100,7 @@ PATCHLIST := \ user32-DrawTextExW.ok \ user32-GetSystemMetrics.ok \ user32-GetTipText.ok \ + user32-ShowWindow.ok \ user32-WndProc.ok \ wine.inf-ProductId.ok \ wineboot-HKEY_DYN_DATA.ok \ @@ -1530,6 +1531,23 @@ user32-GetTipText.ok: echo '+ { "Erich E. Hoover", "Fix TOOLTIPS_GetTipText when a NULL instance is used.", 1 },'; \ ) > user32-GetTipText.ok +# Patchset user32-ShowWindow +# | +# | This patchset fixes the following Wine bugs: +# | * [#11582] ShowWindow should avoid interthread no-op messages +# | +# | Modified files: +# | * dlls/user32/tests/msg.c, dlls/user32/winpos.c +# | +.INTERMEDIATE: user32-ShowWindow.ok +user32-ShowWindow.ok: + $(call APPLY_FILE,user32-ShowWindow/0001-user32-tests-Add-interthread-tests-for-calling-ShowW.patch) + $(call APPLY_FILE,user32-ShowWindow/0002-user32-Do-not-call-SendMessage-to-hide-a-window-that.patch) + @( \ + echo '+ { "Drew Ronneberg", "user32/tests: Add interthread tests for calling ShowWindow(SW_HIDE) on a hidden window.", 1 },'; \ + echo '+ { "Drew Ronneberg", "user32: Do not call SendMessage() to hide a window that is already hidden.", 3 },'; \ + ) > user32-ShowWindow.ok + # Patchset user32-WndProc # | # | This patchset fixes the following Wine bugs: diff --git a/patches/user32-ShowWindow/0001-user32-tests-Add-interthread-tests-for-calling-ShowW.patch b/patches/user32-ShowWindow/0001-user32-tests-Add-interthread-tests-for-calling-ShowW.patch new file mode 100644 index 00000000..03097455 --- /dev/null +++ b/patches/user32-ShowWindow/0001-user32-tests-Add-interthread-tests-for-calling-ShowW.patch @@ -0,0 +1,61 @@ +From fd9bbdd0376581345c88bd65f4bbac2de348c202 Mon Sep 17 00:00:00 2001 +From: Drew Ronneberg +Date: Wed, 19 Nov 2014 13:34:54 +0000 +Subject: user32/tests: Add interthread tests for calling ShowWindow(SW_HIDE) + on a hidden window. + +--- + dlls/user32/tests/msg.c | 27 +++++++++++++++++++++++++++ + 1 file changed, 27 insertions(+) + +diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c +index 9b7453f..dfba25d 100644 +--- a/dlls/user32/tests/msg.c ++++ b/dlls/user32/tests/msg.c +@@ -4621,9 +4621,18 @@ static void test_MsgWaitForMultipleObjects(HWND hwnd) + ok(ret == WAIT_IO_COMPLETION, "MsgWaitForMultipleObjectsEx returned %x\n", ret); + } + ++static DWORD CALLBACK show_window_thread(LPVOID arg) ++{ ++ HWND hwnd = arg; ++ ShowWindow(hwnd, SW_HIDE); ++ return 0; ++} ++ + /* test if we receive the right sequence of messages */ + static void test_messages(void) + { ++ DWORD tid, num_msgs; ++ HANDLE thread; + HWND hwnd, hparent, hchild; + HWND hchild2, hbutton; + HMENU hmenu; +@@ -4642,6 +4651,24 @@ static void test_messages(void) + ok( ShowWindow(hwnd, SW_HIDE) == FALSE, "ShowWindow: window was visible\n" ); + ok_sequence(WmEmptySeq, "ShowWindow(SW_HIDE):overlapped, invisible", FALSE); + ++ while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE | PM_QS_SENDMESSAGE)) ++ DispatchMessageA(&msg); ++ ++ /* test ShowWindow(SW_HIDE) on a hidden window from a different thread */ ++ num_msgs = 0; ++ thread = CreateThread(NULL, 0, show_window_thread, hwnd, 0, &tid); ++ ok(thread != NULL, "CreateThread failed, error %d\n", GetLastError()); ++ while (MsgWaitForMultipleObjects(1, &thread, FALSE, INFINITE, QS_SENDMESSAGE) != WAIT_OBJECT_0) ++ { ++ while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE | PM_QS_SENDMESSAGE)) ++ DispatchMessageA(&msg); ++ num_msgs++; ++ } ++ CloseHandle(thread); ++ todo_wine ++ ok(num_msgs == 0, "got %u wakeups from MsgWaitForMultipleObjects\n", num_msgs); ++ ok_sequence(WmEmptySeq, "ShowWindow(SW_HIDE):overlapped, invisible", FALSE); ++ + /* test WM_SETREDRAW on a not visible top level window */ + test_WM_SETREDRAW(hwnd); + +-- +2.1.3 + diff --git a/patches/user32-ShowWindow/0002-user32-Do-not-call-SendMessage-to-hide-a-window-that.patch b/patches/user32-ShowWindow/0002-user32-Do-not-call-SendMessage-to-hide-a-window-that.patch new file mode 100644 index 00000000..4445cb96 --- /dev/null +++ b/patches/user32-ShowWindow/0002-user32-Do-not-call-SendMessage-to-hide-a-window-that.patch @@ -0,0 +1,40 @@ +From fdf3506544cc3400b4a5bae23cf661df214d6292 Mon Sep 17 00:00:00 2001 +From: Drew Ronneberg +Date: Wed, 19 Nov 2014 13:35:01 +0000 +Subject: user32: Do not call SendMessage() to hide a window that is already + hidden (try 3) + +--- + dlls/user32/tests/msg.c | 1 - + dlls/user32/winpos.c | 3 +++ + 2 files changed, 3 insertions(+), 1 deletion(-) + +diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c +index dfba25d..9d448ae 100644 +--- a/dlls/user32/tests/msg.c ++++ b/dlls/user32/tests/msg.c +@@ -4665,7 +4665,6 @@ static void test_messages(void) + num_msgs++; + } + CloseHandle(thread); +- todo_wine + ok(num_msgs == 0, "got %u wakeups from MsgWaitForMultipleObjects\n", num_msgs); + ok_sequence(WmEmptySeq, "ShowWindow(SW_HIDE):overlapped, invisible", FALSE); + +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 ); + } + +-- +2.1.3 + diff --git a/patches/user32-ShowWindow/definition b/patches/user32-ShowWindow/definition new file mode 100644 index 00000000..8de017d2 --- /dev/null +++ b/patches/user32-ShowWindow/definition @@ -0,0 +1 @@ +Fixes: [11582] ShowWindow should avoid interthread no-op messages