瀏覽代碼

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.
tags/v1.12.90
Pierre Ossman 2 年之前
父節點
當前提交
6a1eaff040
共有 1 個檔案被更改,包括 5 行新增1 行删除
  1. 5
    1
      vncviewer/MonitorArrangement.cxx

+ 5
- 1
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 "";

Loading…
取消
儲存