From 1ea8498c4c729f849095e2f4aa3d282de2000a35 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Wed, 4 Jan 2023 20:21:02 +0200 Subject: [PATCH] Retrieve correct names for monitors on Windows --- source/graphics/windows/display.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/graphics/windows/display.cpp b/source/graphics/windows/display.cpp index 09ca2e9..359df9e 100644 --- a/source/graphics/windows/display.cpp +++ b/source/graphics/windows/display.cpp @@ -29,9 +29,13 @@ Display::Display(const string &): monitors.push_back(Monitor()); Monitor &monitor = monitors.back(); monitor.index = monitors.size()-1; - monitor.name = adapter_dev.DeviceString; priv->monitors.push_back(adapter_dev.DeviceName); + DISPLAY_DEVICE monitor_dev; + monitor_dev.cb = sizeof(monitor_dev); + if(EnumDisplayDevices(adapter_dev.DeviceName, 0, &monitor_dev, 0)) + monitor.name = monitor_dev.DeviceString; + if(adapter_dev.StateFlags&DISPLAY_DEVICE_PRIMARY_DEVICE) primary_index = i; -- 2.45.2