From edbcee8c11c573e5a258f2eee0285922f1c835b9 Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Tue, 27 Aug 2024 07:53:21 +1000 Subject: [PATCH] Rebase against b01131ce82ad8306d719f9919e6249af2db5322d. --- ...launching-programs-based-on-file-ass.patch | 197 ------------------ .../0001-winemac.drv-No-Flicker-patch.patch | 16 +- staging/upstream-commit | 2 +- 3 files changed, 9 insertions(+), 206 deletions(-) delete mode 100644 patches/cmd-launch-association/0001-cmd-Support-for-launching-programs-based-on-file-ass.patch diff --git a/patches/cmd-launch-association/0001-cmd-Support-for-launching-programs-based-on-file-ass.patch b/patches/cmd-launch-association/0001-cmd-Support-for-launching-programs-based-on-file-ass.patch deleted file mode 100644 index 1e4b7388..00000000 --- a/patches/cmd-launch-association/0001-cmd-Support-for-launching-programs-based-on-file-ass.patch +++ /dev/null @@ -1,197 +0,0 @@ -From 0173ca4b3352506b76801619ae5a05f338d6ff6e Mon Sep 17 00:00:00 2001 -From: Jason Edmeades -Date: Tue, 16 Jul 2019 13:49:18 +1000 -Subject: [PATCH] cmd: Support for launching programs based on file association - -cmd already handles exe, cmd, bat etc but if you run a file with another extension, -then use the associations set in the registry (for example via ftype / assoc) to -launch a program. This enables you to run test.txt and notepad to pop up, or -fred.msi for msiexec to be launched. - -Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=18154 -Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=36646 ---- - programs/cmd/wcmdmain.c | 139 +++++++++++++++++++++++++++++----------- - 1 file changed, 102 insertions(+), 37 deletions(-) - -diff --git a/programs/cmd/wcmdmain.c b/programs/cmd/wcmdmain.c -index ce48b16d7ec..2d20ee299fa 100644 ---- a/programs/cmd/wcmdmain.c -+++ b/programs/cmd/wcmdmain.c -@@ -1541,8 +1541,10 @@ void WCMD_run_program (WCHAR *command, BOOL called) - - /* 1. If extension supplied, see if that file exists */ - if (extensionsupplied) { -- if (GetFileAttributesW(thisDir) != INVALID_FILE_ATTRIBUTES) { -+ DWORD attribs = GetFileAttributesW(thisDir); -+ if (attribs != INVALID_FILE_ATTRIBUTES && !(attribs&FILE_ATTRIBUTE_DIRECTORY)) { - found = TRUE; -+ WINE_TRACE("Found as file with extension as '%s'\n", wine_dbgstr_w(thisDir)); - } - } - -@@ -1572,6 +1574,7 @@ void WCMD_run_program (WCHAR *command, BOOL called) - } - - if (GetFileAttributesW(thisDir) != INVALID_FILE_ATTRIBUTES) { -+ WINE_TRACE("Found via search and pathext as '%s'\n", wine_dbgstr_w(thisDir)); - found = TRUE; - thisExt = NULL; - } -@@ -1595,6 +1598,7 @@ void WCMD_run_program (WCHAR *command, BOOL called) - RETURN_CODE return_code; - BOOL oldinteractive = interactive; - -+ WINE_TRACE("Calling batch program\n"); - interactive = FALSE; - return_code = WCMD_batch(thisDir, command, NULL, INVALID_HANDLE_VALUE); - interactive = oldinteractive; -@@ -1605,48 +1609,109 @@ void WCMD_run_program (WCHAR *command, BOOL called) - if (return_code != RETURN_CODE_ABORTED && return_code != RETURN_CODE_OLD_CHAINING) - errorlevel = return_code; - return; -- } else { -- DWORD exit_code; -- /* thisDir contains the file to be launched, but with what? -- eg. a.exe will require a.exe to be launched, a.html may be iexplore */ -- hinst = FindExecutableW (thisDir, NULL, temp); -- if ((INT_PTR)hinst < 32) -- console = 0; -- else -- console = SHGetFileInfoW(temp, 0, &psfi, sizeof(psfi), SHGFI_EXETYPE); -- -- ZeroMemory (&st, sizeof(STARTUPINFOW)); -- st.cb = sizeof(STARTUPINFOW); -- init_msvcrt_io_block(&st); -- -- /* Launch the process and if a CUI wait on it to complete -- Note: Launching internal wine processes cannot specify a full path to exe */ -- status = CreateProcessW(thisDir, -- command, NULL, NULL, TRUE, 0, NULL, NULL, &st, &pe); -- free(st.lpReserved2); -- if ((opt_c || opt_k) && !opt_s && !status -- && GetLastError()==ERROR_FILE_NOT_FOUND && command[0]=='\"') { -- /* strip first and last quote WCHARacters and try again */ -- WCMD_strip_quotes(command); -- opt_s = TRUE; -- WCMD_run_program(command, called); -+ } -+ -+ /* Calculate what program will be launched, and whether it is a -+ console application or not. Note the program may be different -+ from the parameter (eg running a .txt file will launch notepad.exe) */ -+ hinst = FindExecutableW (thisDir, NULL, temp); -+ if ((INT_PTR)hinst < 32) -+ console = 0; /* Assume not console app by default */ -+ else -+ console = SHGetFileInfoW(temp, 0, &psfi, sizeof(psfi), SHGFI_EXETYPE); -+ -+ -+ /* If it is not a .com or .exe, try to launch through ShellExecuteExW -+ which takes into account the association for the extension. */ -+ if (ext && (wcsicmp(ext, L".exe") && wcsicmp(ext, L".com"))) { -+ -+ SHELLEXECUTEINFOW shexw; -+ BOOL rc; -+ WCHAR *rawarg; -+ -+ WCMD_parameter(command, 1, &rawarg, FALSE, TRUE); -+ WINE_TRACE("Launching via ShellExecuteEx\n"); -+ memset(&shexw, 0x00, sizeof(shexw)); -+ shexw.cbSize = sizeof(SHELLEXECUTEINFOW); -+ shexw.fMask = SEE_MASK_NO_CONSOLE | /* Run in same console as currently using */ -+ SEE_MASK_NOCLOSEPROCESS; /* We need a process handle to possibly wait on */ -+ shexw.lpFile = thisDir; -+ shexw.lpParameters = rawarg; -+ shexw.nShow = SW_SHOWNORMAL; -+ -+ /* Try to launch the binary or its associated program */ -+ rc = ShellExecuteExW(&shexw); -+ -+ if (rc && (INT_PTR)shexw.hInstApp >= 32) { -+ -+ WINE_TRACE("Successfully launched\n"); -+ -+ /* It worked... Always wait when non-interactive (cmd /c or in -+ batch program), or for console applications */ -+ if (!interactive || (console && !HIWORD(console))) { -+ WINE_TRACE("Waiting for process to end\n"); -+ WaitForSingleObject (shexw.hProcess, INFINITE); -+ } -+ -+ GetExitCodeProcess (shexw.hProcess, &errorlevel); -+ if (errorlevel == STILL_ACTIVE) { -+ WINE_TRACE("Process still running, but returning anyway\n"); -+ errorlevel = 0; -+ } else { -+ WINE_TRACE("Process ended, errorlevel %ld\n", errorlevel); -+ } -+ -+ CloseHandle(pe.hProcess); - return; -+ - } -+ } - -- if (!status) -- break; -+ /* If its a .exe or .com or the shellexecute failed due to no association, -+ CreateProcess directly */ -+ ZeroMemory (&st, sizeof(STARTUPINFOW)); -+ st.cb = sizeof(STARTUPINFOW); -+ init_msvcrt_io_block(&st); -+ -+ /* Launch the process and if a CUI wait on it to complete -+ Note: Launching internal wine processes cannot specify a full path to exe */ -+ WINE_TRACE("Launching via CreateProcess\n"); -+ status = CreateProcessW(thisDir, -+ command, NULL, NULL, TRUE, 0, NULL, NULL, &st, &pe); -+ free(st.lpReserved2); -+ if ((opt_c || opt_k) && !opt_s && !status -+ && GetLastError()==ERROR_FILE_NOT_FOUND && command[0]=='\"') { -+ /* strip first and last quote WCHARacters and try again */ -+ WCMD_strip_quotes(command); -+ opt_s = TRUE; -+ WCMD_run_program(command, called); -+ return; -+ } - -- /* Always wait when non-interactive (cmd /c or in batch program), -- or for console applications */ -- if (!interactive || (console && !HIWORD(console))) -- WaitForSingleObject (pe.hProcess, INFINITE); -- GetExitCodeProcess (pe.hProcess, &exit_code); -- errorlevel = (exit_code == STILL_ACTIVE) ? NO_ERROR : exit_code; -+ if (!status) { -+ WINE_TRACE("Failed to launch via CreateProcess, rc %d (%ld)\n", -+ status, GetLastError()); -+ break; -+ } - -- CloseHandle(pe.hProcess); -- CloseHandle(pe.hThread); -- return; -+ /* Always wait when non-interactive (cmd /c or in batch program), -+ or for console applications */ -+ if (!interactive || (console && !HIWORD(console))) { -+ WINE_TRACE("Waiting for process to end\n"); -+ WaitForSingleObject (pe.hProcess, INFINITE); - } -+ -+ GetExitCodeProcess (pe.hProcess, &errorlevel); -+ if (errorlevel == STILL_ACTIVE) { -+ WINE_TRACE("Process still running, but returning anyway\n"); -+ errorlevel = 0; -+ } else { -+ WINE_TRACE("Process ended, errorlevel %ld\n", errorlevel); -+ } -+ -+ CloseHandle(pe.hProcess); -+ CloseHandle(pe.hThread); -+ return; - } - } - --- -2.45.2 - 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 index 6d7e14e8..126639e9 100644 --- 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 @@ -1,4 +1,4 @@ -From 6d2e0b68dacbece60f35c2fb77effee0a6d8b07d Mon Sep 17 00:00:00 2001 +From 2d72a65d874538ec1032adaf42a28940e6b6a375 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 @@ -10,7 +10,7 @@ Subject: [PATCH] winemac.drv: No Flicker patch 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/dlls/winemac.drv/macdrv.h b/dlls/winemac.drv/macdrv.h -index 5394a3f89fe..71ebfc9ff72 100644 +index f9ada39d38a..89ffa0d5825 100644 --- a/dlls/winemac.drv/macdrv.h +++ b/dlls/winemac.drv/macdrv.h @@ -43,6 +43,7 @@ @@ -19,10 +19,10 @@ index 5394a3f89fe..71ebfc9ff72 100644 extern BOOL allow_software_rendering; +extern BOOL force_backing_store; - extern const char* debugstr_cf(CFTypeRef t); - + extern UINT64 app_icon_callback; + extern UINT64 app_quit_request_callback; diff --git a/dlls/winemac.drv/macdrv_main.c b/dlls/winemac.drv/macdrv_main.c -index 009d9e694a5..3c9425e6f5f 100644 +index ea556aef68d..e67f17f9f43 100644 --- a/dlls/winemac.drv/macdrv_main.c +++ b/dlls/winemac.drv/macdrv_main.c @@ -59,6 +59,7 @@ int use_precise_scrolling = TRUE; @@ -31,9 +31,9 @@ index 009d9e694a5..3c9425e6f5f 100644 int enable_app_nap = FALSE; +BOOL force_backing_store = FALSE; - CFDictionaryRef localized_strings; - -@@ -373,6 +374,9 @@ static void setup_options(void) + UINT64 app_icon_callback = 0; + UINT64 app_quit_request_callback = 0; +@@ -379,6 +380,9 @@ static void setup_options(void) if (!get_config_key(hkey, appkey, "EnableAppNap", buffer, sizeof(buffer))) enable_app_nap = IS_OPTION_TRUE(buffer[0]); diff --git a/staging/upstream-commit b/staging/upstream-commit index 000abbae..1838be8c 100644 --- a/staging/upstream-commit +++ b/staging/upstream-commit @@ -1 +1 @@ -65124f15acc5705eb159d5d920877f0ac4835d27 +b01131ce82ad8306d719f9919e6249af2db5322d