From f5fe9c0c893c1bf522662fc7b4f85e794e7ffaa6 Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Fri, 2 Jul 2021 13:11:39 +1000 Subject: [PATCH] Added winemac.drv-no-flicker-patch patchset --- patches/patchinstall.sh | 16 +++++ .../0001-winemac.drv-No-Flicker-patch.patch | 61 +++++++++++++++++++ .../winemac.drv-no-flicker-patch/definition | 1 + 3 files changed, 78 insertions(+) create mode 100644 patches/winemac.drv-no-flicker-patch/0001-winemac.drv-No-Flicker-patch.patch create mode 100644 patches/winemac.drv-no-flicker-patch/definition diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 2cdc3de7..6f1e449f 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -257,6 +257,7 @@ patch_enable_all () enable_wined3d_zero_inf_shaders="$1" enable_winedbg_Process_Arguments="$1" enable_winedevice_Default_Drivers="$1" + enable_winemac_drv_no_flicker_patch="$1" enable_winemapi_user_xdg_mail="$1" enable_winemenubuilder_Desktop_Icon_Path="$1" enable_winemenubuilder_integration="$1" @@ -813,6 +814,9 @@ patch_enable () winedevice-Default_Drivers) enable_winedevice_Default_Drivers="$2" ;; + winemac.drv-no-flicker-patch) + enable_winemac_drv_no_flicker_patch="$2" + ;; winemapi-user-xdg-mail) enable_winemapi_user_xdg_mail="$2" ;; @@ -3952,6 +3956,18 @@ if test "$enable_winedevice_Default_Drivers" -eq 1; then patch_apply winedevice-Default_Drivers/0004-programs-winedevice-Load-some-common-drivers-and-fix.patch fi +# Patchset winemac.drv-no-flicker-patch +# | +# | This patchset fixes the following Wine bugs: +# | * [#34166] Fullscreen flickering on Mac +# | +# | Modified files: +# | * dlls/winemac.drv/macdrv.h, dlls/winemac.drv/macdrv_main.c, dlls/winemac.drv/opengl.c +# | +if test "$enable_winemac_drv_no_flicker_patch" -eq 1; then + patch_apply winemac.drv-no-flicker-patch/0001-winemac.drv-No-Flicker-patch.patch +fi + # Patchset winemapi-user-xdg-mail # | # | This patchset fixes the following Wine bugs: diff --git a/patches/winemac.drv-no-flicker-patch/0001-winemac.drv-No-Flicker-patch.patch b/patches/winemac.drv-no-flicker-patch/0001-winemac.drv-No-Flicker-patch.patch new file mode 100644 index 00000000..66b93108 --- /dev/null +++ b/patches/winemac.drv-no-flicker-patch/0001-winemac.drv-No-Flicker-patch.patch @@ -0,0 +1,61 @@ +From b3cbf1c996a0a6f9533aa4461f77df08c123f74d Mon Sep 17 00:00:00 2001 +From: Ken Thomases +Date: Tue, 22 Jun 2021 07:56:43 +1000 +Subject: [PATCH] winemac.drv: No Flicker patch + +--- + dlls/winemac.drv/macdrv.h | 1 + + dlls/winemac.drv/macdrv_main.c | 4 ++++ + dlls/winemac.drv/opengl.c | 2 +- + 3 files changed, 6 insertions(+), 1 deletion(-) + +diff --git a/dlls/winemac.drv/macdrv.h b/dlls/winemac.drv/macdrv.h +index a7c0b4cac87..be119c50d48 100644 +--- a/dlls/winemac.drv/macdrv.h ++++ b/dlls/winemac.drv/macdrv.h +@@ -41,6 +41,7 @@ + extern BOOL allow_software_rendering DECLSPEC_HIDDEN; + extern BOOL disable_window_decorations DECLSPEC_HIDDEN; + extern HMODULE macdrv_module DECLSPEC_HIDDEN; ++extern BOOL force_backing_store DECLSPEC_HIDDEN; + + + extern const char* debugstr_cf(CFTypeRef t) DECLSPEC_HIDDEN; +diff --git a/dlls/winemac.drv/macdrv_main.c b/dlls/winemac.drv/macdrv_main.c +index 203e993ee93..2e5c1329a2a 100644 +--- a/dlls/winemac.drv/macdrv_main.c ++++ b/dlls/winemac.drv/macdrv_main.c +@@ -63,6 +63,7 @@ int gl_surface_mode = GL_SURFACE_IN_FRONT_OPAQUE; + int retina_enabled = FALSE; + HMODULE macdrv_module = 0; + int enable_app_nap = FALSE; ++BOOL force_backing_store = FALSE; + + CFDictionaryRef localized_strings; + +@@ -213,6 +214,9 @@ static void setup_options(void) + if (!get_config_key(hkey, appkey, "EnableAppNap", buffer, sizeof(buffer))) + enable_app_nap = IS_OPTION_TRUE(buffer[0]); + ++ if (!get_config_key(hkey, appkey, "ForceOpenGLBackingStore", buffer, sizeof(buffer))) ++ force_backing_store = IS_OPTION_TRUE(buffer[0]); ++ + /* Don't use appkey. The DPI and monitor sizes should be consistent for all + processes in the prefix. */ + if (!get_config_key(hkey, NULL, "RetinaMode", buffer, sizeof(buffer))) +diff --git a/dlls/winemac.drv/opengl.c b/dlls/winemac.drv/opengl.c +index 9f02e93d376..f3d4e2850e7 100644 +--- a/dlls/winemac.drv/opengl.c ++++ b/dlls/winemac.drv/opengl.c +@@ -1477,7 +1477,7 @@ static BOOL create_context(struct wgl_context *context, CGLContextObj share, uns + attribs[n++] = pf->samples; + } + +- if (pf->backing_store) ++ if (force_backing_store || pf->backing_store) + attribs[n++] = kCGLPFABackingStore; + + #if defined(MAC_OS_X_VERSION_10_7) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7 +-- +2.30.2 + diff --git a/patches/winemac.drv-no-flicker-patch/definition b/patches/winemac.drv-no-flicker-patch/definition new file mode 100644 index 00000000..07e4cb43 --- /dev/null +++ b/patches/winemac.drv-no-flicker-patch/definition @@ -0,0 +1 @@ +Fixes: [34166] Fullscreen flickering on Mac