You've already forked wine-staging
mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-09-12 18:50:20 -07:00
Rebase against c13351c05af43aa542938e0c0935b154a8166905
This commit is contained in:
@@ -1,60 +0,0 @@
|
||||
From 67e34d580dc8ca1115c8e8b0d53cf7649c4c3dcf Mon Sep 17 00:00:00 2001
|
||||
From: Ken Thomases <ken@codeweavers.com>
|
||||
Date: Sat, 18 Oct 2014 22:33:04 +0200
|
||||
Subject: winex11: Make GetMonitorInfo() give a different device name
|
||||
(\.\DISPLAY<n>) to each monitor
|
||||
|
||||
---
|
||||
dlls/winex11.drv/xinerama.c | 12 ++++++++++--
|
||||
1 file changed, 10 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/dlls/winex11.drv/xinerama.c b/dlls/winex11.drv/xinerama.c
|
||||
index 7e28726..ace84c5 100644
|
||||
--- a/dlls/winex11.drv/xinerama.c
|
||||
+++ b/dlls/winex11.drv/xinerama.c
|
||||
@@ -30,6 +30,7 @@
|
||||
#include "wine/library.h"
|
||||
#include "x11drv.h"
|
||||
#include "wine/debug.h"
|
||||
+#include "wine/unicode.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(x11drv);
|
||||
|
||||
@@ -43,6 +44,7 @@ static MONITORINFOEXW default_monitor =
|
||||
MONITORINFOF_PRIMARY, /* dwFlags */
|
||||
{ '\\','\\','.','\\','D','I','S','P','L','A','Y','1',0 } /* szDevice */
|
||||
};
|
||||
+static const WCHAR monitor_deviceW[] = { '\\','\\','.','\\','D','I','S','P','L','A','Y','%','d',0 };
|
||||
|
||||
static MONITORINFOEXW *monitors;
|
||||
static int nb_monitors;
|
||||
@@ -127,6 +129,8 @@ static int query_screens(void)
|
||||
if (monitors != &default_monitor) HeapFree( GetProcessHeap(), 0, monitors );
|
||||
if ((monitors = HeapAlloc( GetProcessHeap(), 0, count * sizeof(*monitors) )))
|
||||
{
|
||||
+ int device = 2; /* 1 is reserved for primary */
|
||||
+
|
||||
nb_monitors = count;
|
||||
for (i = 0; i < nb_monitors; i++)
|
||||
{
|
||||
@@ -138,11 +142,15 @@ static int query_screens(void)
|
||||
monitors[i].dwFlags = 0;
|
||||
if (!IntersectRect( &monitors[i].rcWork, &rc_work, &monitors[i].rcMonitor ))
|
||||
monitors[i].rcWork = monitors[i].rcMonitor;
|
||||
- /* FIXME: using the same device name for all monitors for now */
|
||||
- lstrcpyW( monitors[i].szDevice, default_monitor.szDevice );
|
||||
}
|
||||
|
||||
get_primary()->dwFlags |= MONITORINFOF_PRIMARY;
|
||||
+
|
||||
+ for (i = 0; i < nb_monitors; i++)
|
||||
+ {
|
||||
+ snprintfW( monitors[i].szDevice, sizeof(monitors[i].szDevice) / sizeof(WCHAR),
|
||||
+ monitor_deviceW, (monitors[i].dwFlags & MONITORINFOF_PRIMARY) ? 1 : device++ );
|
||||
+ }
|
||||
}
|
||||
else count = 0;
|
||||
|
||||
--
|
||||
1.9.1
|
||||
|
@@ -1,138 +0,0 @@
|
||||
From 5133a02b554cf4e9d10548be321bef52d25b4477 Mon Sep 17 00:00:00 2001
|
||||
From: Ken Thomases <ken@codeweavers.com>
|
||||
Date: Sat, 18 Oct 2014 23:39:48 +0200
|
||||
Subject: user32: Implement EnumDisplayDevicesW() based on
|
||||
EnumDisplayMonitors() and GetMonitorInfoW().
|
||||
|
||||
---
|
||||
dlls/user32/misc.c | 96 +++++++++++++++++++++++++++++++++++++++++++++++-------
|
||||
1 file changed, 84 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/dlls/user32/misc.c b/dlls/user32/misc.c
|
||||
index 2e6cc35..b1d1bd8 100644
|
||||
--- a/dlls/user32/misc.c
|
||||
+++ b/dlls/user32/misc.c
|
||||
@@ -226,11 +226,74 @@ DWORD WINAPI SetLogonNotifyWindow(HWINSTA hwinsta,HWND hwnd)
|
||||
return 1;
|
||||
}
|
||||
|
||||
-static const WCHAR primary_device_name[] = {'\\','\\','.','\\','D','I','S','P','L','A','Y','1',0};
|
||||
-static const WCHAR primary_device_string[] = {'X','1','1',' ','W','i','n','d','o','w','i','n','g',' ',
|
||||
- 'S','y','s','t','e','m',0};
|
||||
-static const WCHAR primary_device_deviceid[] = {'P','C','I','\\','V','E','N','_','0','0','0','0','&',
|
||||
+static const WCHAR adapter_device_string[] = {'W','i','n','e',' ','D','i','s','p','l','a','y',' ',
|
||||
+ 'A','d','a','p','t','e','r',0};
|
||||
+static const WCHAR adapter_device_deviceid[] = {'P','C','I','\\','V','E','N','_','0','0','0','0','&',
|
||||
'D','E','V','_','0','0','0','0',0};
|
||||
+static const WCHAR display_device_name[] = {'%','s','\\','M','o','n','i','t','o','r','0',0};
|
||||
+static const WCHAR display_device_string[] = {'W','i','n','e',' ','D','i','s','p','l','a','y',0};
|
||||
+static const WCHAR display_device_deviceid[] = {'M','O','N','I','T','O','R','\\','W','I','N','E','%','0','4','d',0};
|
||||
+
|
||||
+struct display_devices_enum_info
|
||||
+{
|
||||
+ LPCWSTR adapter;
|
||||
+ DWORD target;
|
||||
+ DWORD non_primary_seen;
|
||||
+ LPDISPLAY_DEVICEW device;
|
||||
+};
|
||||
+
|
||||
+/***********************************************************************
|
||||
+ * display_devices_enum
|
||||
+ *
|
||||
+ * Helper callback for EnumDisplayDevicesW()
|
||||
+ */
|
||||
+static BOOL CALLBACK display_devices_enum( HMONITOR monitor, HDC hdc, LPRECT rect, LPARAM lp )
|
||||
+{
|
||||
+ struct display_devices_enum_info *info = (struct display_devices_enum_info *)lp;
|
||||
+ MONITORINFOEXW mon_info;
|
||||
+ BOOL match;
|
||||
+
|
||||
+ mon_info.cbSize = sizeof(mon_info);
|
||||
+ GetMonitorInfoW( monitor, (MONITORINFO*)&mon_info );
|
||||
+
|
||||
+ if (!(mon_info.dwFlags & MONITORINFOF_PRIMARY))
|
||||
+ info->non_primary_seen++;
|
||||
+
|
||||
+ if (info->adapter)
|
||||
+ {
|
||||
+ match = !strcmpiW( info->adapter, mon_info.szDevice );
|
||||
+ if (match)
|
||||
+ {
|
||||
+ snprintfW( info->device->DeviceName, sizeof(info->device->DeviceName) / sizeof(WCHAR),
|
||||
+ display_device_name, mon_info.szDevice );
|
||||
+ lstrcpynW( info->device->DeviceString, display_device_string, sizeof(info->device->DeviceString) / sizeof(WCHAR) );
|
||||
+
|
||||
+ if (info->device->cb >= offsetof(DISPLAY_DEVICEW, DeviceID) + sizeof(info->device->DeviceID))
|
||||
+ {
|
||||
+ snprintfW( info->device->DeviceID, sizeof(info->device->DeviceID) / sizeof(WCHAR),
|
||||
+ display_device_deviceid, (mon_info.dwFlags & MONITORINFOF_PRIMARY) ? 0 : info->non_primary_seen );
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ if (mon_info.dwFlags & MONITORINFOF_PRIMARY)
|
||||
+ match = (info->target == 0);
|
||||
+ else
|
||||
+ match = (info->target == info->non_primary_seen);
|
||||
+
|
||||
+ if (match)
|
||||
+ {
|
||||
+ lstrcpynW( info->device->DeviceName, mon_info.szDevice, sizeof(info->device->DeviceName) / sizeof(WCHAR) );
|
||||
+ lstrcpynW( info->device->DeviceString, adapter_device_string, sizeof(info->device->DeviceString) / sizeof(WCHAR) );
|
||||
+
|
||||
+ if (info->device->cb >= offsetof(DISPLAY_DEVICEW, DeviceID) + sizeof(info->device->DeviceID))
|
||||
+ lstrcpynW( info->device->DeviceID, adapter_device_deviceid, sizeof(info->device->DeviceID) / sizeof(WCHAR) );
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return !match;
|
||||
+}
|
||||
|
||||
/***********************************************************************
|
||||
* EnumDisplayDevicesA (USER32.@)
|
||||
@@ -271,24 +334,33 @@ BOOL WINAPI EnumDisplayDevicesA( LPCSTR lpDevice, DWORD i, LPDISPLAY_DEVICEA lpD
|
||||
BOOL WINAPI EnumDisplayDevicesW( LPCWSTR lpDevice, DWORD i, LPDISPLAY_DEVICEW lpDisplayDevice,
|
||||
DWORD dwFlags )
|
||||
{
|
||||
- FIXME("(%s,%d,%p,0x%08x), stub!\n",debugstr_w(lpDevice),i,lpDisplayDevice,dwFlags);
|
||||
+ struct display_devices_enum_info info;
|
||||
|
||||
- if (i)
|
||||
+ TRACE("(%s,%d,%p,0x%08x)\n",debugstr_w(lpDevice),i,lpDisplayDevice,dwFlags);
|
||||
+
|
||||
+ if (lpDevice && i)
|
||||
return FALSE;
|
||||
|
||||
- memcpy(lpDisplayDevice->DeviceName, primary_device_name, sizeof(primary_device_name));
|
||||
- memcpy(lpDisplayDevice->DeviceString, primary_device_string, sizeof(primary_device_string));
|
||||
-
|
||||
lpDisplayDevice->StateFlags =
|
||||
DISPLAY_DEVICE_ATTACHED_TO_DESKTOP |
|
||||
- DISPLAY_DEVICE_PRIMARY_DEVICE |
|
||||
DISPLAY_DEVICE_VGA_COMPATIBLE;
|
||||
|
||||
- if(lpDisplayDevice->cb >= offsetof(DISPLAY_DEVICEW, DeviceID) + sizeof(lpDisplayDevice->DeviceID))
|
||||
- memcpy(lpDisplayDevice->DeviceID, primary_device_deviceid, sizeof(primary_device_deviceid));
|
||||
+ if (!lpDevice && i == 0)
|
||||
+ lpDisplayDevice->StateFlags |= DISPLAY_DEVICE_PRIMARY_DEVICE;
|
||||
+
|
||||
+ info.adapter = lpDevice;
|
||||
+ info.target = i;
|
||||
+ info.non_primary_seen = 0;
|
||||
+ info.device = lpDisplayDevice;
|
||||
+ if (EnumDisplayMonitors( 0, NULL, display_devices_enum, (LPARAM)&info ))
|
||||
+ return FALSE;
|
||||
+
|
||||
if(lpDisplayDevice->cb >= offsetof(DISPLAY_DEVICEW, DeviceKey) + sizeof(lpDisplayDevice->DeviceKey))
|
||||
lpDisplayDevice->DeviceKey[0] = 0;
|
||||
|
||||
+ TRACE("DeviceName %s DeviceString %s DeviceID %s DeviceKey %s\n", debugstr_w(lpDisplayDevice->DeviceName),
|
||||
+ debugstr_w(lpDisplayDevice->DeviceString), debugstr_w(lpDisplayDevice->DeviceID), debugstr_w(lpDisplayDevice->DeviceKey));
|
||||
+
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
--
|
||||
1.9.1
|
||||
|
@@ -1,61 +0,0 @@
|
||||
From 547a92d26b034a226b65a64aec229412129bdd61 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Sat, 27 May 2017 04:15:55 +0200
|
||||
Subject: [PATCH] user32: Return a more reasonable display DeviceID.
|
||||
|
||||
---
|
||||
dlls/user32/misc.c | 7 ++++++-
|
||||
dlls/user32/tests/monitor.c | 12 ++++++++++++
|
||||
2 files changed, 18 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/user32/misc.c b/dlls/user32/misc.c
|
||||
index a6b7644020f..c1c812dbd51 100644
|
||||
--- a/dlls/user32/misc.c
|
||||
+++ b/dlls/user32/misc.c
|
||||
@@ -249,7 +249,12 @@ static const WCHAR adapter_device_deviceid[] = {'P','C','I','\\','V','E','N','_'
|
||||
'D','E','V','_','0','0','0','0',0};
|
||||
static const WCHAR display_device_name[] = {'%','s','\\','M','o','n','i','t','o','r','0',0};
|
||||
static const WCHAR display_device_string[] = {'W','i','n','e',' ','D','i','s','p','l','a','y',0};
|
||||
-static const WCHAR display_device_deviceid[] = {'M','O','N','I','T','O','R','\\','W','I','N','E','%','0','4','d',0};
|
||||
+static const WCHAR display_device_deviceid[] = {'M','O','N','I','T','O','R','\\',
|
||||
+ 'D','e','f','a','u','l','t','_','M','o','n','i','t','o','r','\\',
|
||||
+ '{','4','D','3','6','E','9','6','E','-','E','3','2','5','-',
|
||||
+ '1','1','C','E','-','B','F','C','1','-',
|
||||
+ '0','8','0','0','2','B','E','1','0','3','1','8','}','\\',
|
||||
+ '%','0','4','d',0};
|
||||
|
||||
struct display_devices_enum_info
|
||||
{
|
||||
diff --git a/dlls/user32/tests/monitor.c b/dlls/user32/tests/monitor.c
|
||||
index 8bf284a5e1c..6a886da1b63 100644
|
||||
--- a/dlls/user32/tests/monitor.c
|
||||
+++ b/dlls/user32/tests/monitor.c
|
||||
@@ -225,6 +225,7 @@ static void test_enumdisplaydevices(void)
|
||||
int adapter_index;
|
||||
int monitor_index;
|
||||
BOOL ret;
|
||||
+ int num;
|
||||
|
||||
if (!pEnumDisplayDevicesA)
|
||||
{
|
||||
@@ -276,6 +277,17 @@ static void test_enumdisplaydevices(void)
|
||||
ok(!strcmp(primary_monitor_device_name, primary_device_name),
|
||||
"monitor device name %s, device name %s\n", primary_monitor_device_name,
|
||||
primary_device_name);
|
||||
+
|
||||
+ dd.cb = sizeof(dd);
|
||||
+ for (num = 0;; num++)
|
||||
+ {
|
||||
+ ret = pEnumDisplayDevicesA(primary_device_name, num, &dd, 0);
|
||||
+ if (!ret) break;
|
||||
+
|
||||
+ dd.DeviceID[63] = 0;
|
||||
+ ok(!strcasecmp(dd.DeviceID, "Monitor\\Default_Monitor\\{4D36E96E-E325-11CE-BFC1-08002BE10318}\\"),
|
||||
+ "DeviceID \"%s\" does not start with \"Monitor\\Default_Monitor\\...\" prefix\n", dd.DeviceID);
|
||||
+ }
|
||||
}
|
||||
|
||||
struct vid_mode
|
||||
--
|
||||
2.20.1
|
||||
|
Reference in New Issue
Block a user