mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2024-11-21 16:46:54 -08:00
Added user32-QueryDisplayConfig
This commit is contained in:
parent
ee89d77f18
commit
0e493bcef1
@ -263,6 +263,7 @@ patch_enable_all ()
|
||||
enable_user32_LoadKeyboardLayoutEx="$1"
|
||||
enable_user32_MessageBox_WS_EX_TOPMOST="$1"
|
||||
enable_user32_Mouse_Message_Hwnd="$1"
|
||||
enable_user32_QueryDisplayConfig="$1"
|
||||
enable_user32_Refresh_MDI_Menus="$1"
|
||||
enable_user32_ScrollWindowEx="$1"
|
||||
enable_user32_ShowWindow="$1"
|
||||
@ -881,6 +882,9 @@ patch_enable ()
|
||||
user32-Mouse_Message_Hwnd)
|
||||
enable_user32_Mouse_Message_Hwnd="$2"
|
||||
;;
|
||||
user32-QueryDisplayConfig)
|
||||
enable_user32_QueryDisplayConfig="$2"
|
||||
;;
|
||||
user32-Refresh_MDI_Menus)
|
||||
enable_user32_Refresh_MDI_Menus="$2"
|
||||
;;
|
||||
@ -5230,6 +5234,21 @@ if test "$enable_user32_Mouse_Message_Hwnd" -eq 1; then
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
# Patchset user32-QueryDisplayConfig
|
||||
# |
|
||||
# | This patchset fixes the following Wine bugs:
|
||||
# | * [#49583] Implement QueryDisplayConfig
|
||||
# |
|
||||
# | Modified files:
|
||||
# | * dlls/user32/sysparams.c
|
||||
# |
|
||||
if test "$enable_user32_QueryDisplayConfig" -eq 1; then
|
||||
patch_apply user32-QueryDisplayConfig/0001-user32-Implement-QueryDisplayConfig.patch
|
||||
(
|
||||
printf '%s\n' '+ { "Derek Lesho", "user32: Implement QueryDisplayConfig.", 1 },';
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
# Patchset user32-Refresh_MDI_Menus
|
||||
# |
|
||||
# | This patchset fixes the following Wine bugs:
|
||||
|
@ -0,0 +1,117 @@
|
||||
From 72e9a5081e40600b857d357c8111e344e68aa22f Mon Sep 17 00:00:00 2001
|
||||
From: Derek Lesho <dlesho@codeweavers.com>
|
||||
Date: Fri, 10 Jan 2020 15:34:45 -0600
|
||||
Subject: [PATCH] user32: Implement QueryDisplayConfig
|
||||
|
||||
---
|
||||
dlls/user32/sysparams.c | 89 ++++++++++++++++++++++++++++++++++-------
|
||||
1 file changed, 74 insertions(+), 15 deletions(-)
|
||||
|
||||
diff --git a/dlls/user32/sysparams.c b/dlls/user32/sysparams.c
|
||||
index a29d17d72ce..84aed3dedb4 100644
|
||||
--- a/dlls/user32/sysparams.c
|
||||
+++ b/dlls/user32/sysparams.c
|
||||
@@ -4757,26 +4757,85 @@ LONG WINAPI QueryDisplayConfig(UINT32 flags, UINT32 *numpathelements, DISPLAYCON
|
||||
LUID gpu_luid;
|
||||
WCHAR device_name[CCHDEVICENAME];
|
||||
DEVMODEW devmode;
|
||||
+ POINT origin;
|
||||
+ HMONITOR monitor;
|
||||
+ MONITORINFOEXW monitor_info;
|
||||
+ DISPLAYCONFIG_SOURCE_MODE *source_mode = &modeinfo[0].DUMMYUNIONNAME.sourceMode;
|
||||
+ DISPLAYCONFIG_TARGET_MODE *target_mode = &modeinfo[1].DUMMYUNIONNAME.targetMode;
|
||||
+ DISPLAYCONFIG_PATH_SOURCE_INFO *source_info = &pathinfo[0].sourceInfo;
|
||||
+ DISPLAYCONFIG_PATH_TARGET_INFO *target_info = &pathinfo[0].targetInfo;
|
||||
|
||||
- FIXME("(%08x %p %p %p %p %p): semi-stub\n", flags, numpathelements, pathinfo, numinfoelements, modeinfo, topologyid);
|
||||
+ TRACE("(%08x %p %p %p %p %p)\n", flags, numpathelements, pathinfo, numinfoelements, modeinfo, topologyid);
|
||||
|
||||
- if (!numpathelements || !numinfoelements)
|
||||
- return ERROR_INVALID_PARAMETER;
|
||||
+ if (*numpathelements < 1 || *numinfoelements < 2)
|
||||
+ return ERROR_INSUFFICIENT_BUFFER;
|
||||
|
||||
- if (!*numpathelements || !*numinfoelements)
|
||||
- return ERROR_INVALID_PARAMETER;
|
||||
-
|
||||
- if (flags != QDC_ALL_PATHS &&
|
||||
- flags != QDC_ONLY_ACTIVE_PATHS &&
|
||||
- flags != QDC_DATABASE_CURRENT)
|
||||
- return ERROR_INVALID_PARAMETER;
|
||||
+ origin.x = 0;
|
||||
+ origin.y = 0;
|
||||
+ monitor = MonitorFromPoint(origin, MONITOR_DEFAULTTOPRIMARY);
|
||||
+ monitor_info.cbSize = sizeof(monitor_info);
|
||||
+ if (!(GetMonitorInfoW(monitor, (MONITORINFO*) &monitor_info)))
|
||||
+ {
|
||||
+ return ERROR_GEN_FAILURE;
|
||||
+ }
|
||||
+ if (!(EnumDisplaySettingsW(monitor_info.szDevice, 0, &devmode)))
|
||||
+ {
|
||||
+ return ERROR_GEN_FAILURE;
|
||||
+ }
|
||||
|
||||
- if (((flags == QDC_DATABASE_CURRENT) && !topologyid) ||
|
||||
- ((flags != QDC_DATABASE_CURRENT) && topologyid))
|
||||
- return ERROR_INVALID_PARAMETER;
|
||||
+ AllocateLocallyUniqueId(&gpu_luid);
|
||||
+
|
||||
+ source_mode->width = devmode.dmPelsWidth;
|
||||
+ source_mode->height = devmode.dmPelsHeight;
|
||||
+ source_mode->pixelFormat = DISPLAYCONFIG_PIXELFORMAT_32BPP;
|
||||
+ source_mode->position.x = 0;
|
||||
+ source_mode->position.y = 0;
|
||||
+
|
||||
+ /* no idea what pixel rate is */
|
||||
+ target_mode->targetVideoSignalInfo.pixelRate = 0xdeadbeef;
|
||||
+ target_mode->targetVideoSignalInfo.hSyncFreq.Numerator = devmode.dmDisplayFrequency * devmode.dmPelsHeight;
|
||||
+ target_mode->targetVideoSignalInfo.hSyncFreq.Denominator = 1;
|
||||
+ target_mode->targetVideoSignalInfo.vSyncFreq.Numerator = devmode.dmDisplayFrequency;
|
||||
+ target_mode->targetVideoSignalInfo.vSyncFreq.Denominator = 1;
|
||||
+ target_mode->targetVideoSignalInfo.activeSize.cx = devmode.dmPelsWidth;
|
||||
+ target_mode->targetVideoSignalInfo.activeSize.cy = devmode.dmPelsHeight;
|
||||
+ target_mode->targetVideoSignalInfo.totalSize.cx = devmode.dmPelsWidth;
|
||||
+ target_mode->targetVideoSignalInfo.totalSize.cy = devmode.dmPelsHeight;
|
||||
+ target_mode->targetVideoSignalInfo.DUMMYUNIONNAME.videoStandard = D3DKMDT_VSS_NTSC_M;
|
||||
+ target_mode->targetVideoSignalInfo.scanLineOrdering = DISPLAYCONFIG_SCANLINE_ORDERING_UNSPECIFIED;
|
||||
+
|
||||
+ modeinfo[0].infoType = DISPLAYCONFIG_MODE_INFO_TYPE_SOURCE;
|
||||
+ modeinfo[0].id = 0;
|
||||
+ modeinfo[0].adapterId = gpu_luid;
|
||||
+ modeinfo[1].infoType = DISPLAYCONFIG_MODE_INFO_TYPE_TARGET;
|
||||
+ modeinfo[1].id = 0;
|
||||
+ modeinfo[1].adapterId = gpu_luid;
|
||||
+
|
||||
+ source_info->adapterId = gpu_luid;
|
||||
+ source_info->id = 0;
|
||||
+ source_info->DUMMYUNIONNAME.modeInfoIdx = 0;
|
||||
+ source_info->statusFlags = DISPLAYCONFIG_SOURCE_IN_USE;
|
||||
+
|
||||
+ target_info->adapterId = gpu_luid;
|
||||
+ target_info->id = 0;
|
||||
+
|
||||
+ target_info->DUMMYUNIONNAME.modeInfoIdx = 1;
|
||||
+ target_info->outputTechnology = DISPLAYCONFIG_OUTPUT_TECHNOLOGY_HDMI;
|
||||
+ target_info->rotation = DISPLAYCONFIG_ROTATION_IDENTITY;
|
||||
+ target_info->scaling = DISPLAYCONFIG_SCALING_IDENTITY;
|
||||
+ target_info->refreshRate.Numerator = devmode.dmDisplayFrequency;
|
||||
+ target_info->refreshRate.Denominator = 1;
|
||||
+ target_info->scanLineOrdering = DISPLAYCONFIG_SCANLINE_ORDERING_UNSPECIFIED;
|
||||
+ target_info->targetAvailable = TRUE;
|
||||
+ target_info->statusFlags = DISPLAYCONFIG_TARGET_IN_USE;
|
||||
+
|
||||
+ pathinfo[0].flags = DISPLAYCONFIG_PATH_ACTIVE;
|
||||
+
|
||||
+ if (flags == QDC_DATABASE_CURRENT && topologyid)
|
||||
+ {
|
||||
+ *topologyid = DISPLAYCONFIG_TOPOLOGY_INTERNAL;
|
||||
+ }
|
||||
|
||||
- if (flags != QDC_ONLY_ACTIVE_PATHS)
|
||||
- FIXME("only returning active paths\n");
|
||||
|
||||
if (topologyid)
|
||||
{
|
||||
--
|
||||
2.27.0
|
||||
|
1
patches/user32-QueryDisplayConfig/definition
Normal file
1
patches/user32-QueryDisplayConfig/definition
Normal file
@ -0,0 +1 @@
|
||||
Fixes: [49583] Implement QueryDisplayConfig
|
Loading…
Reference in New Issue
Block a user