mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-01-28 22:04:43 -08:00
Rebase against ed8358393413d52096c56e96b44ee73f15053f91.
This commit is contained in:
parent
261a981d77
commit
364ce82bd1
@ -52,7 +52,7 @@ usage()
|
||||
# Get the upstream commit sha
|
||||
upstream_commit()
|
||||
{
|
||||
echo "6d66efa3fee7f529bba6c478e71d54e0d66995f5"
|
||||
echo "ed8358393413d52096c56e96b44ee73f15053f91"
|
||||
}
|
||||
|
||||
# Show version information
|
||||
@ -306,7 +306,6 @@ patch_enable_all ()
|
||||
enable_winepulse_PulseAudio_Support="$1"
|
||||
enable_winevulkan_vkGetPhysicalDeviceSurfaceCapabilitiesKHR="$1"
|
||||
enable_winex11_CandidateWindowPos="$1"
|
||||
enable_winex11_DefaultDisplayFrequency="$1"
|
||||
enable_winex11_MWM_Decorations="$1"
|
||||
enable_winex11_UpdateLayeredWindow="$1"
|
||||
enable_winex11_Vulkan_support="$1"
|
||||
@ -1009,9 +1008,6 @@ patch_enable ()
|
||||
winex11-CandidateWindowPos)
|
||||
enable_winex11_CandidateWindowPos="$2"
|
||||
;;
|
||||
winex11-DefaultDisplayFrequency)
|
||||
enable_winex11_DefaultDisplayFrequency="$2"
|
||||
;;
|
||||
winex11-MWM_Decorations)
|
||||
enable_winex11_MWM_Decorations="$2"
|
||||
;;
|
||||
@ -5917,18 +5913,6 @@ if test "$enable_winex11_CandidateWindowPos" -eq 1; then
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
# Patchset winex11-DefaultDisplayFrequency
|
||||
# |
|
||||
# | Modified files:
|
||||
# | * dlls/winex11.drv/settings.c, dlls/winex11.drv/x11drv.h, dlls/winex11.drv/x11drv_main.c
|
||||
# |
|
||||
if test "$enable_winex11_DefaultDisplayFrequency" -eq 1; then
|
||||
patch_apply winex11-DefaultDisplayFrequency/0001-winex11.drv-Allow-to-select-default-display-frequenc.patch
|
||||
(
|
||||
printf '%s\n' '+ { "Michael Müller", "winex11.drv: Allow to select default display frequency in registry key.", 1 },';
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
# Patchset winex11-MWM_Decorations
|
||||
# |
|
||||
# | This patchset fixes the following Wine bugs:
|
||||
|
@ -1,147 +0,0 @@
|
||||
From 143a62bdfaed5466d42835682b7d9de35cee8423 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Thu, 5 Nov 2015 14:33:48 +0100
|
||||
Subject: [PATCH] winex11.drv: Allow to select default display frequency in
|
||||
registry key.
|
||||
|
||||
When an application doesn't request a specific display frequency, Wine
|
||||
currently just picks the first one. Most of the time this is fine, but
|
||||
there is no way to switch to a different frequency. This patch adds a
|
||||
registry key (of type STRING) to select the default display frequency:
|
||||
|
||||
HKCU\Software\Wine\X11 Driver\DefaultDisplayFrequency
|
||||
---
|
||||
dlls/winex11.drv/settings.c | 54 ++++++++++++++++++++++++----------
|
||||
dlls/winex11.drv/x11drv.h | 1 +
|
||||
dlls/winex11.drv/x11drv_main.c | 4 +++
|
||||
3 files changed, 44 insertions(+), 15 deletions(-)
|
||||
|
||||
diff --git a/dlls/winex11.drv/settings.c b/dlls/winex11.drv/settings.c
|
||||
index 28c405ae0e0..dcda676788f 100644
|
||||
--- a/dlls/winex11.drv/settings.c
|
||||
+++ b/dlls/winex11.drv/settings.c
|
||||
@@ -526,7 +526,7 @@ LONG CDECL X11DRV_ChangeDisplaySettingsEx( LPCWSTR devname, LPDEVMODEW devmode,
|
||||
DEVMODEW default_mode, *full_mode;
|
||||
ULONG_PTR id;
|
||||
LONG ret;
|
||||
- DWORD i;
|
||||
+ DWORD i, mode;
|
||||
|
||||
/* Use the new interface if it is available */
|
||||
if (!handler.name)
|
||||
@@ -621,6 +621,7 @@ old_interface:
|
||||
return DISP_CHANGE_SUCCESSFUL;
|
||||
}
|
||||
|
||||
+ mode = ENUM_CURRENT_SETTINGS;
|
||||
for (i = 0; i < dd_mode_count; i++)
|
||||
{
|
||||
if (devmode->dmFields & DM_BITSPERPEL)
|
||||
@@ -638,12 +639,24 @@ old_interface:
|
||||
if (devmode->dmPelsHeight != dd_modes[i].height)
|
||||
continue;
|
||||
}
|
||||
- if ((devmode->dmFields & DM_DISPLAYFREQUENCY) && (dd_modes[i].refresh_rate != 0) &&
|
||||
+ if ((devmode->dmFields & DM_DISPLAYFREQUENCY) &&
|
||||
devmode->dmDisplayFrequency != 0 && devmode->dmDisplayFrequency != 1)
|
||||
{
|
||||
- if (devmode->dmDisplayFrequency != dd_modes[i].refresh_rate)
|
||||
+ if (dd_modes[i].refresh_rate != 0 &&
|
||||
+ devmode->dmDisplayFrequency != dd_modes[i].refresh_rate)
|
||||
continue;
|
||||
}
|
||||
+ else if (default_display_frequency != 0)
|
||||
+ {
|
||||
+ if (dd_modes[i].refresh_rate != 0 &&
|
||||
+ default_display_frequency == dd_modes[i].refresh_rate)
|
||||
+ {
|
||||
+ TRACE("Found display mode %d with default frequency (%s)\n", i, handler_name);
|
||||
+ mode = i;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
/* we have a valid mode */
|
||||
TRACE("Requested display settings match mode %d (%s)\n", i, handler_name);
|
||||
|
||||
@@ -660,20 +673,31 @@ old_interface:
|
||||
return DISP_CHANGE_SUCCESSFUL;
|
||||
}
|
||||
|
||||
- if (!(flags & (CDS_TEST | CDS_NORESET)))
|
||||
- return pSetCurrentMode(i);
|
||||
+ if (mode == ENUM_CURRENT_SETTINGS)
|
||||
+ mode = i;
|
||||
+ }
|
||||
|
||||
- return DISP_CHANGE_SUCCESSFUL;
|
||||
+ if (mode == ENUM_CURRENT_SETTINGS)
|
||||
+ {
|
||||
+ /* no valid modes found, only print the fields we were trying to matching against */
|
||||
+ bpp_buffer[0] = freq_buffer[0] = 0;
|
||||
+ if (devmode->dmFields & DM_BITSPERPEL)
|
||||
+ sprintf(bpp_buffer, "bpp=%u ", devmode->dmBitsPerPel);
|
||||
+ if ((devmode->dmFields & DM_DISPLAYFREQUENCY) && (devmode->dmDisplayFrequency != 0))
|
||||
+ sprintf(freq_buffer, "freq=%u ", devmode->dmDisplayFrequency);
|
||||
+ ERR("No matching mode found: width=%d height=%d %s%s(%s)\n",
|
||||
+ devmode->dmPelsWidth, devmode->dmPelsHeight, bpp_buffer, freq_buffer, handler_name);
|
||||
+ return DISP_CHANGE_BADMODE;
|
||||
}
|
||||
|
||||
- /* no valid modes found, only print the fields we were trying to matching against */
|
||||
- bpp_buffer[0] = freq_buffer[0] = 0;
|
||||
- if (devmode->dmFields & DM_BITSPERPEL)
|
||||
- sprintf(bpp_buffer, "bpp=%u ", devmode->dmBitsPerPel);
|
||||
- if ((devmode->dmFields & DM_DISPLAYFREQUENCY) && (devmode->dmDisplayFrequency != 0))
|
||||
- sprintf(freq_buffer, "freq=%u ", devmode->dmDisplayFrequency);
|
||||
- ERR("No matching mode found: width=%d height=%d %s%s(%s)\n",
|
||||
- devmode->dmPelsWidth, devmode->dmPelsHeight, bpp_buffer, freq_buffer, handler_name);
|
||||
+ /* we have a valid mode */
|
||||
+ TRACE("Requested display settings match mode %d (%s)\n", mode, handler_name);
|
||||
+
|
||||
+ if (flags & CDS_UPDATEREGISTRY)
|
||||
+ write_registry_settings(devname, devmode);
|
||||
+
|
||||
+ if (!(flags & (CDS_TEST | CDS_NORESET)))
|
||||
+ return pSetCurrentMode(mode);
|
||||
|
||||
- return DISP_CHANGE_BADMODE;
|
||||
+ return DISP_CHANGE_SUCCESSFUL;
|
||||
}
|
||||
diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h
|
||||
index c47394f97b2..c4967bbb12f 100644
|
||||
--- a/dlls/winex11.drv/x11drv.h
|
||||
+++ b/dlls/winex11.drv/x11drv.h
|
||||
@@ -403,6 +403,7 @@ extern BOOL private_color_map DECLSPEC_HIDDEN;
|
||||
extern int primary_monitor DECLSPEC_HIDDEN;
|
||||
extern int copy_default_colors DECLSPEC_HIDDEN;
|
||||
extern int alloc_system_colors DECLSPEC_HIDDEN;
|
||||
+extern int default_display_frequency DECLSPEC_HIDDEN;
|
||||
extern int xrender_error_base DECLSPEC_HIDDEN;
|
||||
extern HMODULE x11drv_module DECLSPEC_HIDDEN;
|
||||
extern char *process_name DECLSPEC_HIDDEN;
|
||||
diff --git a/dlls/winex11.drv/x11drv_main.c b/dlls/winex11.drv/x11drv_main.c
|
||||
index 4b163aaafbb..da6f7edbabe 100644
|
||||
--- a/dlls/winex11.drv/x11drv_main.c
|
||||
+++ b/dlls/winex11.drv/x11drv_main.c
|
||||
@@ -85,6 +85,7 @@ BOOL client_side_with_render = TRUE;
|
||||
BOOL shape_layered_windows = TRUE;
|
||||
int copy_default_colors = 128;
|
||||
int alloc_system_colors = 256;
|
||||
+int default_display_frequency = 0;
|
||||
DWORD thread_data_tls_index = TLS_OUT_OF_INDEXES;
|
||||
int xrender_error_base = 0;
|
||||
HMODULE x11drv_module = 0;
|
||||
@@ -438,6 +439,9 @@ static void setup_options(void)
|
||||
if (!get_config_key( hkey, appkey, "AllocSystemColors", buffer, sizeof(buffer) ))
|
||||
alloc_system_colors = atoi(buffer);
|
||||
|
||||
+ if (!get_config_key( hkey, appkey, "DefaultDisplayFrequency", buffer, sizeof(buffer) ))
|
||||
+ default_display_frequency = atoi(buffer);
|
||||
+
|
||||
get_config_key( hkey, appkey, "InputStyle", input_style, sizeof(input_style) );
|
||||
|
||||
if (appkey) RegCloseKey( appkey );
|
||||
--
|
||||
2.27.0
|
||||
|
@ -1 +0,0 @@
|
||||
Fixes: Allow to specify default display frequency in registry
|
@ -1 +1 @@
|
||||
6d66efa3fee7f529bba6c478e71d54e0d66995f5
|
||||
ed8358393413d52096c56e96b44ee73f15053f91
|
||||
|
Loading…
x
Reference in New Issue
Block a user