Fix clicking Toad for Oracle treeview nodes doesn't function. The left button click is sent to a top-level TSafeHintWindow, which returns HTTRANSPARENT when handling WM_NCHITTEST. Tests show that in such cases, the mouse message should be sent to the next top-level window in the z-order.
From: Zhiyi Zhang zzhang@codeweavers.com
Fix clicking Toad for Oracle treeview nodes doesn't function. The left button click is sent to a top-level TSafeHintWindow, which returns HTTRANSPARENT when handling WM_NCHITTEST. Tests show that in such cases, the mouse message should be sent to the next top-level window in the z-order. --- dlls/user32/tests/input.c | 8 ++++---- dlls/win32u/message.c | 2 ++ 2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/dlls/user32/tests/input.c b/dlls/user32/tests/input.c index 9196e67c15b..677b2714fcc 100644 --- a/dlls/user32/tests/input.c +++ b/dlls/user32/tests/input.c @@ -4233,12 +4233,12 @@ static void test_SendInput_mouse_messages(void)
mouse_event( MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0 ); wait_messages( 5, FALSE ); - button_down_hwnd_todo[1].message.hwnd = hwnd; - ok_seq( button_down_hwnd_todo ); + button_down_hwnd[1].message.hwnd = hwnd; + ok_seq( button_down_hwnd ); mouse_event( MOUSEEVENTF_LEFTUP, 0, 0, 0, 0 ); wait_messages( 5, FALSE ); - button_up_hwnd_todo[1].message.hwnd = hwnd; - ok_seq( button_up_hwnd_todo ); + button_up_hwnd[1].message.hwnd = hwnd; + ok_seq( button_up_hwnd );
ok_ret( 1, DestroyWindow( other ) ); wait_messages( 0, FALSE ); diff --git a/dlls/win32u/message.c b/dlls/win32u/message.c index a0cbfbce95c..3d0db361d78 100644 --- a/dlls/win32u/message.c +++ b/dlls/win32u/message.c @@ -2444,6 +2444,8 @@ static BOOL process_mouse_message( MSG *msg, UINT hw_id, ULONG_PTR extra_info, H is_current_thread_window( next )) msg->hwnd = window_from_point( next, msg->pt, &hittest ); } + if (!msg->hwnd) /* Try the next top-level window */ + msg->hwnd = window_from_point( 0, msg->pt, &hittest ); }
if (!msg->hwnd || !is_current_thread_window( msg->hwnd ))
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=148767
Your paranoid android.
=== w11pro64_amd (64 bit report) ===
user32: input.c:4260: Test failed: button_down_hwnd 0: got MSG_TEST_WIN hwnd 0000000000050076, msg WM_LBUTTONDOWN, wparam 0x1, lparam 0x320032 input.c:4260: Test failed: button_down_hwnd 1 (missing): MSG_TEST_WIN hwnd 0000000000050076, WM_LBUTTONDOWN, wparam 0x1, lparam 0x320032 input.c:4305: Test failed: button_down_hwnd_todo 1 (missing): MSG_TEST_WIN hwnd 0000000000050076, WM_LBUTTONDOWN, wparam 0x1, lparam 0x320032 input.c:4309: Test failed: button_up_hwnd 1: got MSG_TEST_WIN hwnd 0000000000050076, msg WM_LBUTTONDOWN, wparam 0x1, lparam 0x320032 input.c:4309: Test failed: button_up_hwnd 2 (spurious): got MSG_TEST_WIN hwnd 0000000000050076, msg WM_LBUTTONUP, wparam 0, lparam 0x320032
=== debian11 (32 bit he:IL report) ===
user32: input.c:4305: Test succeeded inside todo block: button_down_hwnd_todo 1: got MSG_TEST_WIN hwnd 000400A0, msg WM_LBUTTONDOWN, wparam 0x1, lparam 0x320032
The problem is that the next window may be some other X11 app and we don't want clicks to go through that.