Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- dlls/user32/spy.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/dlls/user32/spy.c b/dlls/user32/spy.c index ddd90e664fc..8a2fa430b5d 100644 --- a/dlls/user32/spy.c +++ b/dlls/user32/spy.c @@ -1150,7 +1150,7 @@ static const char * const CCMMessageTypeNames[SPY_MAX_CCMMSGNUM + 1] = "CCM_SETNOTIFYWINDOW" };
-#define SPY_MAX_WINEMSGNUM (WM_WINE_MOUSE_LL_HOOK - WM_WINE_DESTROYWINDOW) +#define SPY_MAX_WINEMSGNUM (WM_WINE_CLIPCURSOR - WM_WINE_DESTROYWINDOW) static const char * const WINEMessageTypeNames[SPY_MAX_WINEMSGNUM + 1] = { "WM_WINE_DESTROYWINDOW", @@ -1162,6 +1162,7 @@ static const char * const WINEMessageTypeNames[SPY_MAX_WINEMSGNUM + 1] = "WM_WINE_SETACTIVEWINDOW", "WM_WINE_KEYBOARD_LL_HOOK", "WM_WINE_MOUSE_LL_HOOK", + "WM_WINE_CLIPCURSOR", };
/* Virtual key names */
Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- It should fix an occasional hang in Word 2016 when opening / closing the ribbon with Ctrl-F1.
dlls/user32/message.c | 3 +++ dlls/user32/spy.c | 3 ++- dlls/user32/user_private.h | 2 ++ dlls/user32/win.c | 8 +++++++- 4 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/dlls/user32/message.c b/dlls/user32/message.c index 2717d91dbb5..45fc07bbff3 100644 --- a/dlls/user32/message.c +++ b/dlls/user32/message.c @@ -1890,6 +1890,9 @@ static LRESULT handle_internal_message( HWND hwnd, UINT msg, WPARAM wparam, LPAR return USER_Driver->pClipCursor( &rect ); } return USER_Driver->pClipCursor( NULL ); + case WM_WINE_UPDATEWINDOWSTATE: + update_window_state( hwnd ); + return 0; default: if (msg >= WM_WINE_FIRST_DRIVER_MSG && msg <= WM_WINE_LAST_DRIVER_MSG) return USER_Driver->pWindowMessage( hwnd, msg, wparam, lparam ); diff --git a/dlls/user32/spy.c b/dlls/user32/spy.c index 8a2fa430b5d..dea97547b38 100644 --- a/dlls/user32/spy.c +++ b/dlls/user32/spy.c @@ -1150,7 +1150,7 @@ static const char * const CCMMessageTypeNames[SPY_MAX_CCMMSGNUM + 1] = "CCM_SETNOTIFYWINDOW" };
-#define SPY_MAX_WINEMSGNUM (WM_WINE_CLIPCURSOR - WM_WINE_DESTROYWINDOW) +#define SPY_MAX_WINEMSGNUM (WM_WINE_UPDATEWINDOWSTATE - WM_WINE_DESTROYWINDOW) static const char * const WINEMessageTypeNames[SPY_MAX_WINEMSGNUM + 1] = { "WM_WINE_DESTROYWINDOW", @@ -1163,6 +1163,7 @@ static const char * const WINEMessageTypeNames[SPY_MAX_WINEMSGNUM + 1] = "WM_WINE_KEYBOARD_LL_HOOK", "WM_WINE_MOUSE_LL_HOOK", "WM_WINE_CLIPCURSOR", + "WM_WINE_UPDATEWINDOWSTATE", };
/* Virtual key names */ diff --git a/dlls/user32/user_private.h b/dlls/user32/user_private.h index 7e294558ef1..0230dd45001 100644 --- a/dlls/user32/user_private.h +++ b/dlls/user32/user_private.h @@ -56,6 +56,7 @@ enum wine_internal_message WM_WINE_KEYBOARD_LL_HOOK, WM_WINE_MOUSE_LL_HOOK, WM_WINE_CLIPCURSOR, + WM_WINE_UPDATEWINDOWSTATE, WM_WINE_FIRST_DRIVER_MSG = 0x80001000, /* range of messages reserved for the USER driver */ WM_WINE_LAST_DRIVER_MSG = 0x80001fff }; @@ -243,6 +244,7 @@ extern void move_window_bits( HWND hwnd, struct window_surface *old_surface, const RECT *window_rect, const RECT *valid_rects ) DECLSPEC_HIDDEN; extern void move_window_bits_parent( HWND hwnd, HWND parent, const RECT *window_rect, const RECT *valid_rects ) DECLSPEC_HIDDEN; +extern void update_window_state( HWND hwnd ) DECLSPEC_HIDDEN; extern void *get_hook_proc( void *proc, const WCHAR *module, HMODULE *free_module ) DECLSPEC_HIDDEN; extern RECT get_virtual_screen_rect(void) DECLSPEC_HIDDEN; extern LRESULT call_current_hook( HHOOK hhook, INT code, WPARAM wparam, LPARAM lparam ) DECLSPEC_HIDDEN; diff --git a/dlls/user32/win.c b/dlls/user32/win.c index 3323ed3e41b..49cebe99790 100644 --- a/dlls/user32/win.c +++ b/dlls/user32/win.c @@ -445,11 +445,17 @@ static void send_parent_notify( HWND hwnd, UINT msg ) * * Trigger an update of the window's driver state and surface. */ -static void update_window_state( HWND hwnd ) +void update_window_state( HWND hwnd ) { DPI_AWARENESS_CONTEXT context; RECT window_rect, client_rect, valid_rects[2];
+ if (!WIN_IsCurrentThread( hwnd )) + { + PostMessageW( hwnd, WM_WINE_UPDATEWINDOWSTATE, 0, 0 ); + return; + } + context = SetThreadDpiAwarenessContext( GetWindowDpiAwarenessContext( hwnd )); WIN_GetRectangles( hwnd, COORDS_PARENT, &window_rect, &client_rect ); valid_rects[0] = valid_rects[1] = client_rect;
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=72836
Your paranoid android.
=== debiant (32 bit Chinese:China report) ===
user32: clipboard.c:833: Test failed: 2: gle 5 clipboard.c:838: Test failed: 2.0: got 0000 instead of 000d clipboard.c:868: Test failed: 2: gle 1418 clipboard.c:717: Test failed: 3: gle 5 clipboard.c:719: Test failed: 3: gle 1418 clipboard.c:746: Test failed: 3: count 5 clipboard.c:749: Test failed: 3: gle 1418 clipboard.c:755: Test failed: 3: 0003 not available clipboard.c:757: Test failed: 3: count 5 instead of 2 clipboard.c:760: Test failed: 3: gle 5 clipboard.c:765: Test failed: 3.0: got 0000 instead of 000e clipboard.c:805: Test failed: 3: gle 1418 clipboard.c:815: Test failed: 3: count 5 clipboard.c:818: Test failed: 3: gle 1418 clipboard.c:826: Test failed: 3: 0003 not available clipboard.c:828: Test failed: 3: count 5 instead of 2 clipboard.c:833: Test failed: 3: gle 5 clipboard.c:838: Test failed: 3.0: got 0000 instead of 000e clipboard.c:868: Test failed: 3: gle 1418 clipboard.c:717: Test failed: 4: gle 5 clipboard.c:719: Test failed: 4: gle 1418 clipboard.c:746: Test failed: 4: count 6 clipboard.c:749: Test failed: 4: gle 1418 clipboard.c:757: Test failed: 4: count 6 instead of 2 clipboard.c:760: Test failed: 4: gle 5 clipboard.c:765: Test failed: 4.0: got 0000 instead of 0003 clipboard.c:805: Test failed: 4: gle 1418 clipboard.c:815: Test failed: 4: count 6 clipboard.c:818: Test failed: 4: gle 1418 clipboard.c:828: Test failed: 4: count 6 instead of 2 clipboard.c:833: Test failed: 4: gle 5 clipboard.c:838: Test failed: 4.0: got 0000 instead of 0003 clipboard.c:868: Test failed: 4: gle 1418 clipboard.c:717: Test failed: 5: gle 5 clipboard.c:719: Test failed: 5: gle 1418 clipboard.c:746: Test failed: 5: count 7 clipboard.c:749: Test failed: 5: gle 1418 clipboard.c:755: Test failed: 5: 0008 not available clipboard.c:755: Test failed: 5: 0011 not available clipboard.c:757: Test failed: 5: count 7 instead of 3 clipboard.c:760: Test failed: 5: gle 5 clipboard.c:765: Test failed: 5.0: got 0000 instead of 0002 clipboard.c:805: Test failed: 5: gle 1418 clipboard.c:815: Test failed: 5: count 7 clipboard.c:818: Test failed: 5: gle 1418 clipboard.c:826: Test failed: 5: 0008 not available clipboard.c:826: Test failed: 5: 0011 not available clipboard.c:828: Test failed: 5: count 7 instead of 3 clipboard.c:833: Test failed: 5: gle 5 clipboard.c:838: Test failed: 5.0: got 0000 instead of 0002 clipboard.c:868: Test failed: 5: gle 1418 clipboard.c:717: Test failed: 6: gle 5 clipboard.c:719: Test failed: 6: gle 1418 clipboard.c:746: Test failed: 6: count 8 clipboard.c:749: Test failed: 6: gle 1418 clipboard.c:755: Test failed: 6: 0011 not available clipboard.c:757: Test failed: 6: count 8 instead of 3 clipboard.c:760: Test failed: 6: gle 5 clipboard.c:765: Test failed: 6.0: got 0000 instead of 0008 clipboard.c:805: Test failed: 6: gle 1418 clipboard.c:815: Test failed: 6: count 8 clipboard.c:818: Test failed: 6: gle 1418 clipboard.c:826: Test failed: 6: 0011 not available clipboard.c:828: Test failed: 6: count 8 instead of 3 clipboard.c:833: Test failed: 6: gle 5 clipboard.c:838: Test failed: 6.0: got 0000 instead of 0008 clipboard.c:868: Test failed: 6: gle 1418 clipboard.c:717: Test failed: 7: gle 5 clipboard.c:719: Test failed: 7: gle 1418 clipboard.c:746: Test failed: 7: count 9 clipboard.c:749: Test failed: 7: gle 1418 clipboard.c:757: Test failed: 7: count 9 instead of 3 clipboard.c:760: Test failed: 7: gle 5 clipboard.c:765: Test failed: 7.0: got 0000 instead of 0011 clipboard.c:805: Test failed: 7: gle 1418 clipboard.c:815: Test failed: 7: count 9 clipboard.c:818: Test failed: 7: gle 1418 clipboard.c:828: Test failed: 7: count 9 instead of 3 clipboard.c:833: Test failed: 7: gle 5 clipboard.c:838: Test failed: 7.0: got 0000 instead of 0011 clipboard.c:868: Test failed: 7: gle 1418 clipboard.c:874: Test failed: gle 5 clipboard.c:876: Test failed: gle 1418 clipboard.c:878: Test failed: gle 1418