[PATCH 0/1] MR10324: win32u: Fix deadlock when setting hdc_src to the window's self DC.
Supersed !9180 and !9177 When hdc_src is the window's self DC, there is no need to call AlphaBlend. same as when hdc_src is NULL. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10324
From: Zhao Yi <zhaoyi@uniontech.com> Signed-off-by: Zhao Yi <zhaoyi@uniontech.com> --- dlls/win32u/window.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c index fc129df0785..350c9092de8 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -2678,7 +2678,7 @@ BOOL WINAPI NtUserUpdateLayeredWindow( HWND hwnd, HDC hdc_dst, const POINT *pts_ apply_window_pos( hwnd, 0, swp_flags, surface, &new_rects, NULL ); if (!surface) return FALSE; - if (!hdc_src || surface == &dummy_surface) + if (!hdc_src || surface == &dummy_surface || (NtUserWindowFromDC( hdc_src ) == hwnd)) { user_driver->pUpdateLayeredWindow( hwnd, source_alpha, flags ); ret = TRUE; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10324
There is a test program used to test the deadlock issue caused by setting **hdc_src** to the **window's self DC** when calling the **UpdateLayeredWindow** function. demo: [test-UpdateLayeredWindow.exe](/uploads/96eeece57b90c76daf22c8293f4cb718/test-UpdateLayeredWindow.exe) [test-UpdateLayeredWindow.cpp](/uploads/ebdf27dc9a9fea676fc10b11c8e14a12/test-UpdateLayeredWindow.cpp) -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10324#note_132163
Add some debug logs to the **UpdateLayeredWindow** function as follows: {width=900 height=148} Then running test program test-UpdateLayeredWindow.exe, and deadlock,run result as follows: {width=900 height=183} After applying my MR, run the test program again, and the window displays normally, run result as follows: {width=900 height=372} -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10324#note_132165
Sorry, There are some incorrect behaviors here, and I need to continue analyzing them, so I'm marking this MR as a draft for now. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10324#note_132342
participants (2)
-
Zhao Yi -
Zhao Yi (@Zhaoyi)