Signed-off-by: Roman Pišl rpisl@seznam.cz --- dlls/user32/tests/msg.c | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-)
diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c index 93ab7b4a27..2763857d8a 100644 --- a/dlls/user32/tests/msg.c +++ b/dlls/user32/tests/msg.c @@ -136,7 +136,8 @@ typedef enum { optional=0x80, hook=0x100, winevent_hook=0x200, - kbd_hook=0x400 + kbd_hook=0x400, + has_update=0x800 } msg_flags_t;
struct message { @@ -2547,6 +2548,11 @@ static void ok_sequence_(const struct message *expected_list, const char *contex context, count, expected->message); if ((expected->flags & kbd_hook) != (actual->flags & kbd_hook)) dump++;
+ todo_wine_if(expected->flags & has_update) + ok_( file, line) (!(expected->flags & has_update) || (actual->flags & has_update), + "%s: %u: the msg 0x%04x should have update region\n", + context, count, expected->message); + expected++; actual++; } @@ -7858,6 +7864,11 @@ static const struct message WmPaint[] = { { 0 } };
+static const struct message WmPaintUpdate[] = { + { WM_PAINT, sent|has_update }, + { 0 } +}; + static const struct message WmParentOnlyPaint[] = { { WM_PAINT, sent|parent }, { 0 } @@ -8217,6 +8228,16 @@ static void test_paint_messages(void) } ok_sequence( WmGetUpdateRect, "GetUpdateRect", FALSE );
+ /* RedrawWindow with RDW_VALIDATE triggers WM_PAINT with non-empty update region */ + flush_sequence(); + InvalidateRect( hwnd, NULL, FALSE ); + GetClientRect( hwnd, &rect ); + SetRectRgn( hrgn, rect.left, rect.top, rect.right, rect.bottom ); + check_update_rgn( hwnd, hrgn ); + RedrawWindow( hwnd, &rect, NULL, RDW_INTERNALPAINT|RDW_NOERASE|RDW_NOFRAME|RDW_UPDATENOW|RDW_VALIDATE ); + check_update_rgn( hwnd, 0 ); + ok_sequence( WmPaintUpdate, "PaintUpdate", FALSE ); + DestroyWindow( hwnd );
/* now test with a child window */ @@ -9531,6 +9552,9 @@ static LRESULT MsgCheckProc (BOOL unicode, HWND hwnd, UINT message, msg.flags = sent|wparam|lparam; if (defwndproc_counter) msg.flags |= defwinproc; if (beginpaint_counter) msg.flags |= beginpaint; + + if (message == WM_PAINT && GetUpdateRect(hwnd, NULL, FALSE)) msg.flags |= has_update; + msg.wParam = wParam; msg.lParam = lParam; msg.descr = "MsgCheckProc";
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48761 Signed-off-by: Roman Pišl rpisl@seznam.cz --- dlls/user32/painting.c | 3 +++ dlls/user32/tests/msg.c | 1 - 2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/dlls/user32/painting.c b/dlls/user32/painting.c index 313c5fa1e6..2c8ffc903a 100644 --- a/dlls/user32/painting.c +++ b/dlls/user32/painting.c @@ -1246,6 +1246,9 @@ BOOL WINAPI RedrawWindow( HWND hwnd, const RECT *rect, HRGN hrgn, UINT flags ) dump_rdw_flags(flags); }
+ if ((flags & (RDW_INTERNALPAINT | RDW_UPDATENOW)) == (RDW_INTERNALPAINT | RDW_UPDATENOW)) + flags &= ~RDW_VALIDATE; + /* process pending expose events before painting */ if (flags & RDW_UPDATENOW) USER_Driver->pMsgWaitForMultipleObjectsEx( 0, NULL, 0, QS_PAINT, 0 );
diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c index 2763857d8a..7c223daa44 100644 --- a/dlls/user32/tests/msg.c +++ b/dlls/user32/tests/msg.c @@ -2548,7 +2548,6 @@ static void ok_sequence_(const struct message *expected_list, const char *contex context, count, expected->message); if ((expected->flags & kbd_hook) != (actual->flags & kbd_hook)) dump++;
- todo_wine_if(expected->flags & has_update) ok_( file, line) (!(expected->flags & has_update) || (actual->flags & has_update), "%s: %u: the msg 0x%04x should have update region\n", context, count, expected->message);
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=71042
Your paranoid android.
=== w1064v1809_ja (32 bit report) ===
user32: msg.c:16345: Test failed: 12: WaitForSingleObject failed
=== w1064v1809 (64 bit report) ===
user32: msg.c:12960: Test failed: WmMouseHoverSeq: 0: the msg sequence is not complete: expected 0118 - actual 0000
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=71041
Your paranoid android.
=== w1064v1809_ja (32 bit report) ===
user32: msg.c:8810: Test failed: MsgWaitForMultipleObjects failed 102
=== w1064v1809_zh_CN (32 bit report) ===
user32: msg.c:17886: Test failed: Restore minimized window: 0: the msg 0x0005 was expected, but got msg 0x0024 instead