From: Mikko Rasa Date: Wed, 4 Jan 2023 18:21:02 +0000 (+0200) Subject: Retrieve correct names for monitors on Windows X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=1ea8498c4c729f849095e2f4aa3d282de2000a35;p=libs%2Fgui.git Retrieve correct names for monitors on Windows --- 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;