gdi32-MultiMonitor: Add missing patchset for winemac driver support.

This commit is contained in:
Sebastian Lackner 2015-09-29 02:28:20 +02:00
parent 65be847fcc
commit c498b3557f
2 changed files with 53 additions and 1 deletions

View File

@ -0,0 +1,50 @@
From 2e0137d4d9706af5cc208171358b74ef614770de Mon Sep 17 00:00:00 2001
From: Ken Thomases <ken@codeweavers.com>
Date: Thu, 27 Mar 2014 18:18:46 -0500
Subject: winemac: Make GetMonitorInfo() give a different device name
(\\.\DISPLAY<n>) to each monitor.
---
dlls/winemac.drv/display.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/dlls/winemac.drv/display.c b/dlls/winemac.drv/display.c
index 10ecf67..c708481 100644
--- a/dlls/winemac.drv/display.c
+++ b/dlls/winemac.drv/display.c
@@ -25,6 +25,7 @@
#include "winuser.h"
#include "winreg.h"
#include "ddrawi.h"
+#include "wine/unicode.h"
WINE_DEFAULT_DEBUG_CHANNEL(display);
@@ -935,7 +936,7 @@ done:
*/
BOOL CDECL macdrv_GetMonitorInfo(HMONITOR monitor, LPMONITORINFO info)
{
- static const WCHAR adapter_name[] = { '\\','\\','.','\\','D','I','S','P','L','A','Y','1',0 };
+ static const WCHAR adapter_name[] = { '\\','\\','.','\\','D','I','S','P','L','A','Y','%','d',0 };
struct macdrv_display *displays;
int num_displays;
CGDirectDisplayID display_id;
@@ -965,10 +966,12 @@ BOOL CDECL macdrv_GetMonitorInfo(HMONITOR monitor, LPMONITORINFO info)
info->dwFlags = (i == 0) ? MONITORINFOF_PRIMARY : 0;
if (info->cbSize >= sizeof(MONITORINFOEXW))
- lstrcpyW(((MONITORINFOEXW*)info)->szDevice, adapter_name);
+ snprintfW(((MONITORINFOEXW*)info)->szDevice, sizeof(((MONITORINFOEXW*)info)->szDevice) / sizeof(WCHAR),
+ adapter_name, i + 1);
- TRACE(" -> rcMonitor %s rcWork %s dwFlags %08x\n", wine_dbgstr_rect(&info->rcMonitor),
- wine_dbgstr_rect(&info->rcWork), info->dwFlags);
+ TRACE(" -> rcMonitor %s rcWork %s dwFlags %08x szDevice %s\n", wine_dbgstr_rect(&info->rcMonitor),
+ wine_dbgstr_rect(&info->rcWork), info->dwFlags,
+ info->cbSize >= sizeof(MONITORINFOEXW) ? debugstr_w(((MONITORINFOEXW*)info)->szDevice) : "n/a");
}
else
{
--
2.5.1

View File

@ -3174,16 +3174,18 @@ fi
# | * [#37709] GetMonitorInfo returns the same name for all monitors
# |
# | Modified files:
# | * dlls/gdi32/driver.c, dlls/user32/misc.c, dlls/winex11.drv/xinerama.c
# | * dlls/gdi32/driver.c, dlls/user32/misc.c, dlls/winemac.drv/display.c, dlls/winex11.drv/xinerama.c
# |
if test "$enable_gdi32_MultiMonitor" -eq 1; then
patch_apply gdi32-MultiMonitor/0001-gdi32-Also-accept-.-DISPLAY-n-devices-names-with-n-o.patch
patch_apply gdi32-MultiMonitor/0002-winex11-Make-GetMonitorInfo-give-a-different-device-.patch
patch_apply gdi32-MultiMonitor/0003-user32-Implement-EnumDisplayDevicesW-based-on-EnumDi.patch
patch_apply gdi32-MultiMonitor/0004-winemac-Make-GetMonitorInfo-give-a-different-device-.patch
(
echo '+ { "Ken Thomases", "gdi32: Also accept \"\\\\\\\\.\\\\DISPLAY<n>\" devices names with <n> other than 1 as display devices.", 1 },';
echo '+ { "Ken Thomases", "winex11: Make GetMonitorInfo() give a different device name (\\\\.\\\\DISPLAY<n>) to each monitor.", 1 },';
echo '+ { "Ken Thomases", "user32: Implement EnumDisplayDevicesW() based on EnumDisplayMonitors() and GetMonitorInfoW().", 1 },';
echo '+ { "Ken Thomases", "winemac: Make GetMonitorInfo() give a different device name (\\\\\\\\.\\\\DISPLAY<n>) to each monitor.", 1 },';
) >> "$patchlist"
fi