From: Pierre Ossman Date: Thu, 9 Sep 2021 11:09:10 +0000 (+0200) Subject: More user friendly monitor name on Windows X-Git-Tag: v1.12.90~113 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=6a1eaff040cab5984f9928fb2bba1a983f4c2fd0;p=tigervnc.git More user friendly monitor name on Windows The device name is very internal and likely of little use to a user. Instead give the more user friendly string we can get out of the system. --- diff --git a/vncviewer/MonitorArrangement.cxx b/vncviewer/MonitorArrangement.cxx index a8813fe4..2a864175 100644 --- a/vncviewer/MonitorArrangement.cxx +++ b/vncviewer/MonitorArrangement.cxx @@ -371,6 +371,7 @@ std::string MonitorArrangement::get_monitor_name(int m) for (iter = sys_monitors.begin(); iter != sys_monitors.end(); ++iter) { MONITORINFOEX info; + DISPLAY_DEVICE dev; info.cbSize = sizeof(info); GetMonitorInfo(*iter, (LPMONITORINFO)&info); @@ -384,7 +385,10 @@ std::string MonitorArrangement::get_monitor_name(int m) if ((info.rcMonitor.bottom - info.rcMonitor.top) != h) continue; - return info.szDevice; + dev.cb = sizeof(dev); + EnumDisplayDevices(info.szDevice, 0, &dev, 0); + + return dev.DeviceString; } return "";