From: Esme Povirk esme@codeweavers.com
--- dlls/user32/tests/msg.c | 47 ++++++++++++++++++++++------------------- dlls/win32u/input.c | 6 ++++++ 2 files changed, 31 insertions(+), 22 deletions(-)
diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c index e62616ff456..5bef582ad7d 100644 --- a/dlls/user32/tests/msg.c +++ b/dlls/user32/tests/msg.c @@ -6463,7 +6463,7 @@ static const struct message WmKillFocusOwnerdrawSeq[] = static const struct message WmLButtonDownSeq[] = { { WM_LBUTTONDOWN, sent|wparam|lparam, 0, 0 }, - { EVENT_SYSTEM_CAPTURESTART, winevent_hook|wparam|lparam|msg_todo, 0, 0 }, + { EVENT_SYSTEM_CAPTURESTART, winevent_hook|wparam|lparam, 0, 0 }, { HCBT_SETFOCUS, hook }, { WM_IME_SETCONTEXT, sent|wparam|defwinproc|optional, 1 }, { WM_IME_NOTIFY, sent|wparam|defwinproc|optional, 2 }, @@ -6478,7 +6478,7 @@ static const struct message WmLButtonDownSeq[] = static const struct message WmLButtonDownStaticSeq[] = { { WM_LBUTTONDOWN, sent|wparam|lparam, 0, 0 }, - { EVENT_SYSTEM_CAPTURESTART, winevent_hook|wparam|lparam|msg_todo, 0, 0 }, + { EVENT_SYSTEM_CAPTURESTART, winevent_hook|wparam|lparam, 0, 0 }, { HCBT_SETFOCUS, hook }, { WM_IME_SETCONTEXT, sent|wparam|defwinproc|optional, 1 }, { WM_IME_NOTIFY, sent|wparam|defwinproc|optional, 2 }, @@ -6496,7 +6496,7 @@ static const struct message WmLButtonUpSeq[] = { BM_SETSTATE, sent|wparam|defwinproc, FALSE }, { WM_CTLCOLORBTN, sent|defwinproc }, { EVENT_OBJECT_STATECHANGE, winevent_hook|wparam|lparam|msg_todo, OBJID_CLIENT, 0 }, - { EVENT_SYSTEM_CAPTUREEND, winevent_hook|wparam|lparam|msg_todo, 0, 0 }, + { EVENT_SYSTEM_CAPTUREEND, winevent_hook|wparam|lparam, 0, 0 }, { WM_CAPTURECHANGED, sent|wparam|defwinproc, 0 }, { 0 } }; @@ -6506,7 +6506,7 @@ static const struct message WmLButtonUpStaticSeq[] = { BM_SETSTATE, sent|wparam|defwinproc, FALSE }, { WM_CTLCOLORSTATIC, sent|defwinproc }, { EVENT_OBJECT_STATECHANGE, winevent_hook|wparam|lparam|msg_todo, OBJID_CLIENT, 0 }, - { EVENT_SYSTEM_CAPTUREEND, winevent_hook|wparam|lparam|msg_todo, 0, 0 }, + { EVENT_SYSTEM_CAPTUREEND, winevent_hook|wparam|lparam, 0, 0 }, { WM_CAPTURECHANGED, sent|wparam|defwinproc, 0 }, { 0 } }; @@ -6520,7 +6520,7 @@ static const struct message WmLButtonUpAutoSeq[] = { BM_SETCHECK, sent|defwinproc }, { WM_CTLCOLORSTATIC, sent|defwinproc|optional, 0, 0 }, /* Sent here on Win7. */ { EVENT_OBJECT_STATECHANGE, winevent_hook|wparam|lparam|msg_todo, OBJID_CLIENT, 0 }, - { EVENT_SYSTEM_CAPTUREEND, winevent_hook|wparam|lparam|msg_todo, 0, 0 }, + { EVENT_SYSTEM_CAPTUREEND, winevent_hook|wparam|lparam, 0, 0 }, { WM_CTLCOLORSTATIC, sent|defwinproc|optional, 0, 0 }, /* Sent here on Win8+. */ { WM_CAPTURECHANGED, sent|wparam|defwinproc, 0 }, { 0 } @@ -6678,7 +6678,7 @@ static const struct message WmClearStateButtonSeq[] = static const struct message WmDisableButtonSeq[] = { { WM_LBUTTONDOWN, sent }, - { EVENT_SYSTEM_CAPTURESTART, winevent_hook|wparam|lparam|msg_todo, 0, 0 }, + { EVENT_SYSTEM_CAPTURESTART, winevent_hook|wparam|lparam, 0, 0 }, { BM_SETSTATE, sent|defwinproc }, { WM_CTLCOLORSTATIC, sent|defwinproc|optional }, { WM_CTLCOLORBTN, sent|optional }, @@ -6690,7 +6690,7 @@ static const struct message WmDisableButtonSeq[] = { BM_SETCHECK, sent|defwinproc|optional }, { WM_CTLCOLORBTN, sent|optional }, { EVENT_OBJECT_STATECHANGE, winevent_hook|wparam|lparam|msg_todo, OBJID_CLIENT, 0 }, - { EVENT_SYSTEM_CAPTUREEND, winevent_hook|wparam|lparam|msg_todo, 0, 0 }, + { EVENT_SYSTEM_CAPTUREEND, winevent_hook|wparam|lparam, 0, 0 }, { WM_CTLCOLORSTATIC, sent|defwinproc|optional }, { WM_CAPTURECHANGED, sent|defwinproc }, { WM_COMMAND, sent }, @@ -7247,7 +7247,7 @@ static const struct message auto_radio_button_BM_CLICK[] = { { BM_CLICK, sent|wparam|lparam, 0, 0 }, { WM_LBUTTONDOWN, sent|wparam|lparam|defwinproc, 0, 0 }, - { EVENT_SYSTEM_CAPTURESTART, winevent_hook|wparam|lparam|msg_todo, 0, 0 }, + { EVENT_SYSTEM_CAPTURESTART, winevent_hook|wparam|lparam, 0, 0 }, { BM_SETSTATE, sent|wparam|lparam|defwinproc, BST_CHECKED, ID_RADIO2 }, { WM_CTLCOLORSTATIC, sent|parent }, { EVENT_OBJECT_STATECHANGE, winevent_hook|wparam|lparam|msg_todo, OBJID_CLIENT, 0 }, @@ -7266,7 +7266,7 @@ static const struct message auto_radio_button_BM_CLICK[] = { WM_CTLCOLORSTATIC, sent|parent }, { EVENT_OBJECT_STATECHANGE, winevent_hook|wparam|lparam|msg_todo, OBJID_CLIENT, 0 }, { WM_GETDLGCODE, sent|wparam|lparam|defwinproc, ID_TEXT, 0 }, - { EVENT_SYSTEM_CAPTUREEND, winevent_hook|wparam|lparam|msg_todo, 0, 0 }, + { EVENT_SYSTEM_CAPTUREEND, winevent_hook|wparam|lparam, 0, 0 }, { WM_CAPTURECHANGED, sent|wparam|lparam|defwinproc, 0, 0 }, { WM_COMMAND, sent|wparam|parent, MAKEWPARAM(ID_RADIO2, BN_CLICKED) }, { WM_NCHITTEST, sent|optional, 0, 0 }, @@ -10256,7 +10256,8 @@ static const struct message WmAltVkN[] = { { WM_INITMENU, sent|defwinproc }, { EVENT_SYSTEM_MENUSTART, winevent_hook|wparam|lparam|msg_todo, OBJID_SYSMENU, 0 }, { WM_MENUCHAR, sent|defwinproc|wparam, MAKEWPARAM('n',MF_SYSMENU) }, - { EVENT_SYSTEM_CAPTUREEND, winevent_hook|wparam|lparam|msg_todo, 0, 0 }, + { EVENT_SYSTEM_CAPTURESTART, winevent_hook|wparam|lparam|wine_only, 0, 0 }, + { EVENT_SYSTEM_CAPTUREEND, winevent_hook|wparam|lparam, 0, 0 }, { WM_CAPTURECHANGED, sent|defwinproc }, { WM_MENUSELECT, sent|defwinproc|wparam, MAKEWPARAM(0,0xffff) }, { EVENT_SYSTEM_MENUEND, winevent_hook|wparam|lparam|msg_todo, OBJID_SYSMENU, 0 }, @@ -12797,13 +12798,14 @@ static void test_scrollwindowex(void) }
static const struct message destroy_window_with_children[] = { - { EVENT_SYSTEM_CAPTURESTART, winevent_hook|wparam|lparam|msg_todo, 0, 0 }, /* popup */ + { EVENT_SYSTEM_CAPTURESTART, winevent_hook|wparam|lparam, 0, 0 }, /* popup */ { HCBT_DESTROYWND, hook|lparam, 0, WND_PARENT_ID }, /* parent */ { 0x0090, sent|optional }, { HCBT_DESTROYWND, hook|lparam, 0, WND_POPUP_ID }, /* popup */ { 0x0090, sent|optional }, { EVENT_OBJECT_DESTROY, winevent_hook|wparam|lparam|msg_todo, 0, 0 }, /* popup */ { WM_DESTROY, sent|wparam|lparam, 0, WND_POPUP_ID }, /* popup */ + { EVENT_SYSTEM_CAPTUREEND, winevent_hook|wparam|lparam|wine_only, 0, 0 }, /* popup */ { WM_CAPTURECHANGED, sent|wparam|lparam, 0, WND_POPUP_ID }, /* popup */ { WM_NCDESTROY, sent|wparam|lparam, 0, WND_POPUP_ID }, /* popup */ { EVENT_OBJECT_DESTROY, winevent_hook|wparam|lparam, 0, 0 }, /* parent */ @@ -13214,12 +13216,13 @@ static const struct message sl_edit_killfocus[] = static const struct message sl_edit_lbutton_dblclk[] = { { WM_LBUTTONDBLCLK, sent }, - { EVENT_SYSTEM_CAPTURESTART, winevent_hook|wparam|lparam|msg_todo, 0, 0 }, + { EVENT_SYSTEM_CAPTURESTART, winevent_hook|wparam|lparam, 0, 0 }, { 0 } }; static const struct message sl_edit_lbutton_down[] = { { WM_LBUTTONDOWN, sent|wparam|lparam, 0, 0 }, + { EVENT_SYSTEM_CAPTURESTART, winevent_hook|wparam|lparam|wine_only, 0, 0 }, { HCBT_SETFOCUS, hook }, { WM_IME_SETCONTEXT, sent|wparam|defwinproc|optional, 1 }, { WM_IME_NOTIFY, sent|wparam|defwinproc|optional, 2 }, @@ -13244,7 +13247,7 @@ static const struct message sl_edit_lbutton_down[] = static const struct message ml_edit_lbutton_down[] = { { WM_LBUTTONDOWN, sent|wparam|lparam, 0, 0 }, - { EVENT_SYSTEM_CAPTURESTART, winevent_hook|wparam|lparam|msg_todo, 0, 0 }, + { EVENT_SYSTEM_CAPTURESTART, winevent_hook|wparam|lparam, 0, 0 }, { HCBT_SETFOCUS, hook }, { WM_IME_SETCONTEXT, sent|wparam|defwinproc|optional, 1 }, { WM_IME_NOTIFY, sent|wparam|defwinproc|optional, 2 }, @@ -13262,7 +13265,7 @@ static const struct message sl_edit_lbutton_up[] = { { WM_LBUTTONUP, sent|wparam|lparam, 0, 0 }, { EVENT_OBJECT_HIDE, winevent_hook|wparam|lparam|msg_todo, OBJID_CARET, 0 }, - { EVENT_SYSTEM_CAPTUREEND, winevent_hook|wparam|lparam|msg_todo, 0, 0 }, + { EVENT_SYSTEM_CAPTUREEND, winevent_hook|wparam|lparam, 0, 0 }, { WM_CAPTURECHANGED, sent|defwinproc }, { EVENT_OBJECT_SHOW, winevent_hook|wparam|lparam|msg_todo, OBJID_CARET, 0 }, { 0 } @@ -13270,7 +13273,7 @@ static const struct message sl_edit_lbutton_up[] = static const struct message ml_edit_lbutton_up[] = { { WM_LBUTTONUP, sent|wparam|lparam, 0, 0 }, - { EVENT_SYSTEM_CAPTUREEND, winevent_hook|wparam|lparam|msg_todo, 0, 0 }, + { EVENT_SYSTEM_CAPTUREEND, winevent_hook|wparam|lparam, 0, 0 }, { WM_CAPTURECHANGED, sent|defwinproc }, { 0 } }; @@ -16842,7 +16845,7 @@ static const struct message wm_lb_click_0[] = { WM_COMMAND, sent|wparam|parent, MAKEWPARAM(ID_LISTBOX, LBN_SETFOCUS) }, { EVENT_OBJECT_FOCUS, winevent_hook|wparam|lparam|msg_todo, OBJID_CLIENT, 3 }, { WM_LBTRACKPOINT, sent|wparam|lparam|parent, 0, MAKELPARAM(1,1) }, - { EVENT_SYSTEM_CAPTURESTART, winevent_hook|wparam|lparam|msg_todo, 0, 0 }, + { EVENT_SYSTEM_CAPTURESTART, winevent_hook|wparam|lparam, 0, 0 },
{ WM_DRAWITEM, sent|wparam|lparam|parent, ID_LISTBOX, 0x000142f2 }, { WM_CTLCOLORLISTBOX, sent|parent }, @@ -16855,7 +16858,7 @@ static const struct message wm_lb_click_0[] = { EVENT_OBJECT_SELECTION, winevent_hook|wparam|lparam|msg_todo, OBJID_CLIENT, 1 },
{ WM_LBUTTONUP, sent|wparam|lparam, 0, 0 }, - { EVENT_SYSTEM_CAPTUREEND, winevent_hook|wparam|lparam|msg_todo, 0, 0 }, + { EVENT_SYSTEM_CAPTUREEND, winevent_hook|wparam|lparam, 0, 0 }, { WM_CAPTURECHANGED, sent|wparam|lparam|defwinproc, 0, 0 }, { WM_COMMAND, sent|wparam|parent, MAKEWPARAM(ID_LISTBOX, LBN_SELCHANGE) }, { 0 } @@ -17633,8 +17636,8 @@ static void test_paintingloop(void)
static const struct message NCRBUTTONDOWNSeq[] = { - { EVENT_SYSTEM_CAPTURESTART, winevent_hook|wparam|lparam|msg_todo, 0, 0 }, - { EVENT_SYSTEM_CAPTUREEND, winevent_hook|wparam|lparam|msg_todo, 0, 0 }, + { EVENT_SYSTEM_CAPTURESTART, winevent_hook|wparam|lparam, 0, 0 }, + { EVENT_SYSTEM_CAPTUREEND, winevent_hook|wparam|lparam, 0, 0 }, { WM_CAPTURECHANGED, sent }, { WM_CONTEXTMENU, sent, /*hwnd*/0, -1 }, { 0 } @@ -20222,9 +20225,9 @@ static void test_InSendMessage(void)
static const struct message DoubleSetCaptureSeq[] = { - { EVENT_SYSTEM_CAPTURESTART, winevent_hook|wparam|lparam|msg_todo, 0, 0 }, - { EVENT_SYSTEM_CAPTUREEND, winevent_hook|wparam|lparam|msg_todo, 0, 0 }, - { EVENT_SYSTEM_CAPTURESTART, winevent_hook|wparam|lparam|msg_todo, 0, 0 }, + { EVENT_SYSTEM_CAPTURESTART, winevent_hook|wparam|lparam, 0, 0 }, + { EVENT_SYSTEM_CAPTUREEND, winevent_hook|wparam|lparam, 0, 0 }, + { EVENT_SYSTEM_CAPTURESTART, winevent_hook|wparam|lparam, 0, 0 }, { WM_CAPTURECHANGED, sent }, { 0 } }; diff --git a/dlls/win32u/input.c b/dlls/win32u/input.c index 3a5802b75b6..1cf174760da 100644 --- a/dlls/win32u/input.c +++ b/dlls/win32u/input.c @@ -1806,6 +1806,12 @@ BOOL set_capture_window( HWND hwnd, UINT gui_flags, HWND *prev_ret ) { user_driver->pSetCapture( hwnd, gui_flags );
+ if (previous) + NtUserNotifyWinEvent( EVENT_SYSTEM_CAPTUREEND, previous, OBJID_WINDOW, 0 ); + + if (hwnd) + NtUserNotifyWinEvent( EVENT_SYSTEM_CAPTURESTART, hwnd, OBJID_WINDOW, 0 ); + if (previous) send_message( previous, WM_CAPTURECHANGED, 0, (LPARAM)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=147257
Your paranoid android.
=== debian11 (32 bit ar:MA report) ===
user32: msg.c:6935: Test failed: SetFocus(hwnd) on a button: 3: the winevent_hook 0x8005 was expected, but got hook 0x0005 instead msg.c:6935: Test failed: SetFocus(hwnd) on a button: 3: the winevent_hook 0x8005 was expected, but got winevent_hook 0x0003 instead msg.c:6935: Test failed: SetFocus(hwnd) on a button: 3: the winevent_hook 0x8005 was expected, but got msg 0x030f instead msg.c:6935: Test failed: SetFocus(hwnd) on a button: 3: the winevent_hook 0x8005 was expected, but got msg 0x001c instead msg.c:6935: Test failed: SetFocus(hwnd) on a button: 3: the winevent_hook 0x8005 was expected, but got msg 0x0086 instead msg.c:6935: Test failed: SetFocus(hwnd) on a button: 3: the winevent_hook 0x8005 was expected, but got msg 0x0006 instead msg.c:6935: Test failed: SetFocus(hwnd) on a button: 3: the winevent_hook 0x8005 was expected, but got hook 0x0009 instead
=== debian11b (64 bit WoW report) ===
ddraw: ddraw7.c:3741: Test failed: Expected message 0x5, but didn't receive it. ddraw7.c:3743: Test failed: Expected screen size 1024x768, got 0x0.
This merge request was approved by Rémi Bernon.