diff --git a/README.md b/README.md index 04324d37..2a094ebe 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,11 @@ Wine. All those differences are also documented on the Included bug fixes and improvements =================================== +**Bugfixes and features included in the next upcoming release [1]:** + +* Fix multithreading issues with fullscreen clipping ([Wine Bug #38087](https://bugs.winehq.org/show_bug.cgi?id=38087)) + + **Bugs fixed in Wine Staging 1.7.38 [190]:** * Add Dynamic DST exceptions for Israel Standard Time ([Wine Bug #36374](https://bugs.winehq.org/show_bug.cgi?id=36374)) diff --git a/debian/changelog b/debian/changelog index 9e2345df..f98036f8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,6 @@ wine-staging (1.7.39) UNRELEASED; urgency=low * Added patch for tests of RtlIpv6StringToAddress, RtlIpv{4,6}StringToAddressEx (by Mark Jansen). + * Added patch to fix multithreading issues with fullscreen clipping. -- Sebastian Lackner Mon, 09 Mar 2015 16:52:35 +0100 wine-staging (1.7.38) unstable; urgency=low diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 503218fa..a839286e 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -3430,14 +3430,17 @@ fi # | # | This patchset fixes the following Wine bugs: # | * [#33479] Fix cursor clip regression / broken raw input in multiple games +# | * [#38087] Fix multithreading issues with fullscreen clipping # | # | Modified files: -# | * dlls/user32/message.c, server/queue.c +# | * dlls/user32/message.c, dlls/winex11.drv/mouse.c, server/queue.c # | if test "$enable_server_ClipCursor" -eq 1; then patch_apply server-ClipCursor/0001-server-Only-send-WM_WINE_CLIPCURSOR-for-forced-clip-.patch + patch_apply server-ClipCursor/0002-winex11-Forward-all-clipping-requests-to-the-right-t.patch ( echo '+ { "Sebastian Lackner", "server: Only send WM_WINE_CLIPCURSOR for forced clip resets.", 1 },'; + echo '+ { "Sebastian Lackner", "winex11: Forward all clipping requests to the right thread (including fullscreen clipping).", 1 },'; ) >> "$patchlist" fi diff --git a/patches/server-ClipCursor/0001-server-Only-send-WM_WINE_CLIPCURSOR-for-forced-clip-.patch b/patches/server-ClipCursor/0001-server-Only-send-WM_WINE_CLIPCURSOR-for-forced-clip-.patch index 3065cc43..06243c5f 100644 --- a/patches/server-ClipCursor/0001-server-Only-send-WM_WINE_CLIPCURSOR-for-forced-clip-.patch +++ b/patches/server-ClipCursor/0001-server-Only-send-WM_WINE_CLIPCURSOR-for-forced-clip-.patch @@ -1,32 +1,32 @@ -From 9fc973740aac7d4eac1995f30c9dbb8bbbdc1ce5 Mon Sep 17 00:00:00 2001 +From d4e11dc9293e9faea3edb4c0d7c3defbb621ca97 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Thu, 22 Jan 2015 16:34:58 +0100 Subject: server: Only send WM_WINE_CLIPCURSOR for forced clip resets. --- - dlls/user32/message.c | 6 ------ - server/queue.c | 10 +++++----- - 2 files changed, 5 insertions(+), 11 deletions(-) + dlls/user32/message.c | 6 ++++++ + server/queue.c | 8 ++++---- + 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/dlls/user32/message.c b/dlls/user32/message.c -index eac4e4d..70d95a6 100644 +index eac4e4d..67e1cf4 100644 --- a/dlls/user32/message.c +++ b/dlls/user32/message.c -@@ -1881,12 +1881,6 @@ static LRESULT handle_internal_message( HWND hwnd, UINT msg, WPARAM wparam, LPAR +@@ -1881,6 +1881,12 @@ static LRESULT handle_internal_message( HWND hwnd, UINT msg, WPARAM wparam, LPAR return call_current_hook( h_extra->handle, HC_ACTION, wparam, h_extra->lparam ); } case WM_WINE_CLIPCURSOR: -- if (wparam) -- { -- RECT rect; -- GetClipCursor( &rect ); -- return USER_Driver->pClipCursor( &rect ); -- } - return USER_Driver->pClipCursor( NULL ); - default: - if (msg >= WM_WINE_FIRST_DRIVER_MSG && msg <= WM_WINE_LAST_DRIVER_MSG) ++ if (!lparam) ++ { ++ /* This is just a notification, nothing to do. Clipping will be ++ * done by the process that issues the set_cursor wineserver call. */ ++ return 0; ++ } + if (wparam) + { + RECT rect; diff --git a/server/queue.c b/server/queue.c -index 5f87203..fce2e42 100644 +index 3a321cd..19acbd3 100644 --- a/server/queue.c +++ b/server/queue.c @@ -362,7 +362,7 @@ static void set_cursor_pos( struct desktop *desktop, int x, int y ) @@ -34,18 +34,16 @@ index 5f87203..fce2e42 100644 /* set the cursor clip rectangle */ -static void set_clip_rectangle( struct desktop *desktop, const rectangle_t *rect ) -+static void set_clip_rectangle( struct desktop *desktop, const rectangle_t *rect, int send_clip_msg ) ++static void set_clip_rectangle( struct desktop *desktop, const rectangle_t *rect, int do_clip ) { rectangle_t top_rect; int x, y; -@@ -380,8 +380,8 @@ static void set_clip_rectangle( struct desktop *desktop, const rectangle_t *rect - } +@@ -381,7 +381,7 @@ static void set_clip_rectangle( struct desktop *desktop, const rectangle_t *rect else desktop->cursor.clip = top_rect; -- if (desktop->cursor.clip_msg) + if (desktop->cursor.clip_msg) - post_desktop_message( desktop, desktop->cursor.clip_msg, rect != NULL, 0 ); -+ if (desktop->cursor.clip_msg && send_clip_msg) -+ post_desktop_message( desktop, desktop->cursor.clip_msg, 0, 0 ); ++ post_desktop_message( desktop, desktop->cursor.clip_msg, rect != NULL, do_clip ); /* warp the mouse to be inside the clip rect */ x = min( max( desktop->cursor.x, desktop->cursor.clip.left ), desktop->cursor.clip.right-1 ); @@ -58,7 +56,7 @@ index 5f87203..fce2e42 100644 desktop->foreground_input = input; } -@@ -3024,7 +3024,7 @@ DECL_HANDLER(set_cursor) +@@ -3023,7 +3023,7 @@ DECL_HANDLER(set_cursor) if (req->clip_msg && get_top_window_owner(desktop) == current->process) desktop->cursor.clip_msg = req->clip_msg; @@ -68,5 +66,5 @@ index 5f87203..fce2e42 100644 reply->new_x = input->desktop->cursor.x; -- -2.2.1 +2.3.1 diff --git a/patches/server-ClipCursor/0002-winex11-Forward-all-clipping-requests-to-the-right-t.patch b/patches/server-ClipCursor/0002-winex11-Forward-all-clipping-requests-to-the-right-t.patch new file mode 100644 index 00000000..75e9f5fa --- /dev/null +++ b/patches/server-ClipCursor/0002-winex11-Forward-all-clipping-requests-to-the-right-t.patch @@ -0,0 +1,75 @@ +From ee44b1946cb7001cb47d43a60b3e37d9185705de Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Tue, 10 Mar 2015 04:29:04 +0100 +Subject: winex11: Forward all clipping requests to the right thread (including + fullscreen clipping). + +--- + dlls/winex11.drv/mouse.c | 30 +++++++++++++++--------------- + 1 file changed, 15 insertions(+), 15 deletions(-) + +diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c +index 5f5bdeb..bc20965 100644 +--- a/dlls/winex11.drv/mouse.c ++++ b/dlls/winex11.drv/mouse.c +@@ -446,6 +446,8 @@ void reset_clipping_window(void) + ClipCursor( NULL ); /* make sure the clip rectangle is reset too */ + } + ++BOOL CDECL X11DRV_ClipCursor( LPCRECT clip ); ++ + /*********************************************************************** + * clip_cursor_notify + * +@@ -474,12 +476,10 @@ LRESULT clip_cursor_notify( HWND hwnd, HWND new_clip_hwnd ) + } + else if (hwnd == GetForegroundWindow()) /* request to clip */ + { +- RECT clip, virtual_rect = get_virtual_screen_rect(); ++ RECT clip; + + GetClipCursor( &clip ); +- if (clip.left > virtual_rect.left || clip.right < virtual_rect.right || +- clip.top > virtual_rect.top || clip.bottom < virtual_rect.bottom) +- return grab_clipping_window( &clip ); ++ X11DRV_ClipCursor( &clip ); + } + return 0; + } +@@ -1391,22 +1391,22 @@ BOOL CDECL X11DRV_ClipCursor( LPCRECT clip ) + if (grab_pointer) + { + HWND foreground = GetForegroundWindow(); ++ DWORD tid, pid; ++ ++ /* forward request to the foreground window if it's in a different thread */ ++ tid = GetWindowThreadProcessId( foreground, &pid ); ++ if (tid && tid != GetCurrentThreadId() && pid == GetCurrentProcessId()) ++ { ++ TRACE( "forwarding clip request to %p\n", foreground ); ++ SendNotifyMessageW( foreground, WM_X11DRV_CLIP_CURSOR, 0, 0 ); ++ return TRUE; ++ } + + /* we are clipping if the clip rectangle is smaller than the screen */ + if (clip->left > virtual_rect.left || clip->right < virtual_rect.right || + clip->top > virtual_rect.top || clip->bottom < virtual_rect.bottom) + { +- DWORD tid, pid; +- +- /* forward request to the foreground window if it's in a different thread */ +- tid = GetWindowThreadProcessId( foreground, &pid ); +- if (tid && tid != GetCurrentThreadId() && pid == GetCurrentProcessId()) +- { +- TRACE( "forwarding clip request to %p\n", foreground ); +- SendNotifyMessageW( foreground, WM_X11DRV_CLIP_CURSOR, 0, 0 ); +- return TRUE; +- } +- else if (grab_clipping_window( clip )) return TRUE; ++ if (grab_clipping_window( clip )) return TRUE; + } + else /* if currently clipping, check if we should switch to fullscreen clipping */ + { +-- +2.3.1 + diff --git a/patches/server-ClipCursor/definition b/patches/server-ClipCursor/definition index ef13577b..402e81ea 100644 --- a/patches/server-ClipCursor/definition +++ b/patches/server-ClipCursor/definition @@ -1 +1,2 @@ Fixes: [33479] Fix cursor clip regression / broken raw input in multiple games +Fixes: [38087] Fix multithreading issues with fullscreen clipping