Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=57178
This makes [7-zip file manager](https://www.7-zip.org/) pressing enter while editing path work: * before: * [Icon near path becomes dark (7-zip file manager doesn't go to path).](https://old.reddit.com/r/winehq/comments/16ah3ze/7zip_cant_enter_path_from_p...) * after: * 7-zip file manager goes to path. * Path input displays incorrect path (shouldn't happen, bug in wine's comboboxex unrelated to toolbar).
-- v6: comctl32/toolbar: forward unhandled WM_NOTIFY comctl32/tests: Test WM_NOTIFY forwarding for toolbars.
From: Alanas alanas.00@mail.ru
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=57178 --- dlls/comctl32/tests/toolbar.c | 44 +++++++++++++++++++++++++++++++++-- 1 file changed, 42 insertions(+), 2 deletions(-)
diff --git a/dlls/comctl32/tests/toolbar.c b/dlls/comctl32/tests/toolbar.c index 7c886e1f88f..b1cf382d787 100644 --- a/dlls/comctl32/tests/toolbar.c +++ b/dlls/comctl32/tests/toolbar.c @@ -179,7 +179,20 @@ static BOOL equal_dc(HDC hdc1, HDC hdc2, int width, int height)
static void *alloced_str;
-static LRESULT parent_wnd_notify(LPARAM lParam) +#define TEST_WM_NOTIFY_IDFROM 0xabcd0002 +#define TEST_WM_NOTIFY_CODE 0xabcd0003 +#define TEST_WM_NOTIFY_RETURN 0xabcd0004 +static BOOL expecting_test_WM_NOTIFY; +static const NMHDR test_WM_NOTIFY_nmhdr = +{ + /* .hwndFrom should not be accessed */ + .hwndFrom = (HWND)0xabcd0001, + /* .idFrom and .code don't mean anything */ + .idFrom = TEST_WM_NOTIFY_IDFROM, + .code = TEST_WM_NOTIFY_CODE +}; + +static LRESULT parent_wnd_notify(WPARAM wParam, LPARAM lParam) { NMHDR *hdr = (NMHDR *)lParam; NMTBHOTITEM *nmhi; @@ -371,6 +384,18 @@ static LRESULT parent_wnd_notify(LPARAM lParam)
return 0; } + case TEST_WM_NOTIFY_CODE: + if (expecting_test_WM_NOTIFY) + { + ok(hdr == &test_WM_NOTIFY_nmhdr, "Got unexpected header.\n"); + ok(wParam == TEST_WM_NOTIFY_IDFROM, "Got unexpected wParam 0x%Ix.\n", wParam); + } + else + { + ok(FALSE, "Got unexpected WM_NOTIFY.\n"); + } + expecting_test_WM_NOTIFY = FALSE; + return TEST_WM_NOTIFY_RETURN; } return 0; } @@ -428,7 +453,7 @@ static LRESULT CALLBACK parent_wnd_proc(HWND hWnd, UINT message, WPARAM wParam, switch (message) { case WM_NOTIFY: - return parent_wnd_notify(lParam); + return parent_wnd_notify(wParam, lParam); }
defwndproc_counter++; @@ -2833,6 +2858,20 @@ static void test_BTNS_SEP(void) DestroyWindow(hwnd); }
+static void test_WM_NOTIFY(void) +{ + HWND toolbar = NULL; + LRESULT ret; + + rebuild_toolbar(&toolbar); + expecting_test_WM_NOTIFY = TRUE; + ret = SendMessageA(toolbar, WM_NOTIFY, 0, (LPARAM)&test_WM_NOTIFY_nmhdr); + todo_wine ok(ret == TEST_WM_NOTIFY_RETURN, "SendMessageA returned 0x%Ix\n", ret); + todo_wine ok(!expecting_test_WM_NOTIFY, "toolbar didn't forward WM_NOTIFY to parent\n"); + expecting_test_WM_NOTIFY = FALSE; + DestroyWindow(toolbar); +} + START_TEST(toolbar) { ULONG_PTR ctx_cookie; @@ -2884,6 +2923,7 @@ START_TEST(toolbar) test_drawtext_flags(); test_imagelist(); test_BTNS_SEP(); + test_WM_NOTIFY();
if (!load_v6_module(&ctx_cookie, &ctx)) return;
From: Alanas alanas.00@mail.ru
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=57178 --- dlls/comctl32/tests/toolbar.c | 4 ++-- dlls/comctl32/toolbar.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/dlls/comctl32/tests/toolbar.c b/dlls/comctl32/tests/toolbar.c index b1cf382d787..553b53315df 100644 --- a/dlls/comctl32/tests/toolbar.c +++ b/dlls/comctl32/tests/toolbar.c @@ -2866,8 +2866,8 @@ static void test_WM_NOTIFY(void) rebuild_toolbar(&toolbar); expecting_test_WM_NOTIFY = TRUE; ret = SendMessageA(toolbar, WM_NOTIFY, 0, (LPARAM)&test_WM_NOTIFY_nmhdr); - todo_wine ok(ret == TEST_WM_NOTIFY_RETURN, "SendMessageA returned 0x%Ix\n", ret); - todo_wine ok(!expecting_test_WM_NOTIFY, "toolbar didn't forward WM_NOTIFY to parent\n"); + ok(ret == TEST_WM_NOTIFY_RETURN, "SendMessageA returned 0x%Ix\n", ret); + ok(!expecting_test_WM_NOTIFY, "toolbar didn't forward WM_NOTIFY to parent\n"); expecting_test_WM_NOTIFY = FALSE; DestroyWindow(toolbar); } diff --git a/dlls/comctl32/toolbar.c b/dlls/comctl32/toolbar.c index 690a02db6ee..d12cd25715c 100644 --- a/dlls/comctl32/toolbar.c +++ b/dlls/comctl32/toolbar.c @@ -6360,7 +6360,7 @@ TOOLBAR_Notify (TOOLBAR_INFO *infoPtr, LPNMHDR lpnmh) return 0;
default: - return 0; + return SendMessageW(infoPtr->hwndNotify, WM_NOTIFY, lpnmh->idFrom, (LPARAM)lpnmh); } }
On Thu Oct 31 11:07:42 2024 +0000, Zhiyi Zhang wrote:
If these ok() in parent_wnd_notify() don't have failures before your fix, then you don't need to add todo_wines in parent_wnd_notify().
done
On Thu Oct 31 11:07:55 2024 +0000, Zhiyi Zhang wrote:
Let's put a new line after variable declarations.
done
On Thu Oct 31 11:03:29 2024 +0000, Alanas wrote:
changed this line in [version 6 of the diff](/wine/wine/-/merge_requests/6737/diffs?diff_id=140738&start_sha=eb335455e265f968d43f93b9358e7f2e2ff84b88#03545023fa1893bb952c1403e2cc9d2e6d261397_185_182)
using 4 bytes (`BOOL` is `int`) is unnecessary but ok
done
On Thu Oct 31 11:09:31 2024 +0000, Zhiyi Zhang wrote:
Let's rename the patch subject to "comctl32/tests: Test WM_NOTIFY forwarding for toolbars."
done
On Tue Oct 29 14:36:45 2024 +0000, Alanas wrote:
changed this line in [version 3 of the diff](/wine/wine/-/merge_requests/6737/diffs?diff_id=140548&start_sha=3ced65a8fd4e1e3a3060c74ba4827e71c6b55469#03545023fa1893bb952c1403e2cc9d2e6d261397_2866_2864)
I picked 0