diff --git a/README.md b/README.md index 9b61ce47..f91b4603 100644 --- a/README.md +++ b/README.md @@ -38,11 +38,12 @@ Wine. All those differences are also documented on the Included bug fixes and improvements =================================== -**Bugfixes and features included in the next upcoming release [8]:** +**Bugfixes and features included in the next upcoming release [9]:** * Add stub for gdiplus.GdipCreateEffect ([Wine Bug #32163](https://bugs.winehq.org/show_bug.cgi?id=32163)) * Add support for CopyFileEx progress callback ([Wine Bug #22692](https://bugs.winehq.org/show_bug.cgi?id=22692)) * Allow to cancel a file operation via progress callback ([Wine Bug #22690](https://bugs.winehq.org/show_bug.cgi?id=22690)) +* Enforce that surfaces are flushed after ReleaseDC * Fallback to global key state for threads without a queue ([Wine Bug #27238](https://bugs.winehq.org/show_bug.cgi?id=27238)) * Fix race-condition when threads are killed during shutdown * Implement SetFileInformationByHandle diff --git a/debian/changelog b/debian/changelog index a0fde36d..f712edf8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -16,6 +16,7 @@ wine-staging (1.7.38) UNRELEASED; urgency=low * Added patch for support of shell32 file operation progress dialog. * Added patch for basic implementation of job objects. * Added patch to display animations for SHFileOperation progress dialog. + * Added patch to enforce that surfaces are flushed after ReleaseDC. * Removed patch to properly call DriverUnload when unloading device drivers (accepted upstream). * Removed patch to allow Accept-Encoding for HTTP/1.0 in wininet (accepted upstream). * Removed patch to declare pDirectInputCreateEx in a MSVC compatible way (accepted upstream). diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 4fc2a9e9..a85f6010 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -181,6 +181,7 @@ patch_enable_all () enable_user32_GetSystemMetrics="$1" enable_user32_GetTipText="$1" enable_user32_Mouse_Message_Hwnd="$1" + enable_user32_Painting="$1" enable_user32_ScrollWindowEx="$1" enable_user32_WndProc="$1" enable_vcomp_Stub_Functions="$1" @@ -575,6 +576,9 @@ patch_enable () user32-Mouse_Message_Hwnd) enable_user32_Mouse_Message_Hwnd="$2" ;; + user32-Painting) + enable_user32_Painting="$2" + ;; user32-ScrollWindowEx) enable_user32_ScrollWindowEx="$2" ;; @@ -3647,6 +3651,18 @@ if test "$enable_user32_Mouse_Message_Hwnd" -eq 1; then ) >> "$patchlist" fi +# Patchset user32-Painting +# | +# | Modified files: +# | * dlls/user32/painting.c, dlls/user32/win.c +# | +if test "$enable_user32_Painting" -eq 1; then + patch_apply user32-Painting/0001-user32-Enforce-that-surfaces-are-flushed-after-Relea.patch + ( + echo '+ { "Sebastian Lackner", "user32: Enforce that surfaces are flushed after ReleaseDC.", 1 },'; + ) >> "$patchlist" +fi + # Patchset user32-ScrollWindowEx # | # | This patchset fixes the following Wine bugs: diff --git a/patches/user32-Painting/0001-user32-Enforce-that-surfaces-are-flushed-after-Relea.patch b/patches/user32-Painting/0001-user32-Enforce-that-surfaces-are-flushed-after-Relea.patch new file mode 100644 index 00000000..40639b05 --- /dev/null +++ b/patches/user32-Painting/0001-user32-Enforce-that-surfaces-are-flushed-after-Relea.patch @@ -0,0 +1,41 @@ +From c4a8e65a698c608dd491a0318116fa875b8362ba Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Fri, 27 Feb 2015 22:37:16 +0100 +Subject: user32: Enforce that surfaces are flushed after ReleaseDC. + +If a second thread draws on the surfaces while the main thread is idle then +the window doesn't update properly. Can be reproduced for example with: +https://www-user.tu-chemnitz.de/~heha/petzold/ch20c.htm +--- + dlls/user32/painting.c | 1 + + dlls/user32/win.c | 2 +- + 2 files changed, 2 insertions(+), 1 deletion(-) + +diff --git a/dlls/user32/painting.c b/dlls/user32/painting.c +index 5c1dc69..7be594f 100644 +--- a/dlls/user32/painting.c ++++ b/dlls/user32/painting.c +@@ -1116,6 +1116,7 @@ HDC WINAPI GetWindowDC( HWND hwnd ) + */ + INT WINAPI ReleaseDC( HWND hwnd, HDC hdc ) + { ++ flush_window_surfaces( FALSE ); + return release_dc( hwnd, hdc, FALSE ); + } + +diff --git a/dlls/user32/win.c b/dlls/user32/win.c +index 0516193..5f99e43 100644 +--- a/dlls/user32/win.c ++++ b/dlls/user32/win.c +@@ -598,7 +598,7 @@ void flush_window_surfaces( BOOL idle ) + now = GetTickCount(); + if (idle) last_idle = now; + /* if not idle, we only flush if there's evidence that the app never goes idle */ +- else if ((int)(now - last_idle) < 1000) goto done; ++ else if ((int)(now - last_idle) < 100) goto done; + + LIST_FOR_EACH_ENTRY( surface, &window_surfaces, struct window_surface, entry ) + surface->funcs->flush( surface ); +-- +2.3.0 + diff --git a/patches/user32-Painting/definition b/patches/user32-Painting/definition new file mode 100644 index 00000000..d94ee6ad --- /dev/null +++ b/patches/user32-Painting/definition @@ -0,0 +1 @@ +Fixes: Enforce that surfaces are flushed after ReleaseDC