From 85609ce268bdd6a91cd26e0bda7460862d3f38d7 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Wed, 21 Oct 2015 13:03:59 +0300 Subject: [PATCH] Store monitor names --- source/graphics/monitor.h | 1 + source/graphics/windows/display.cpp | 1 + source/graphics/x11/display.cpp | 1 + 3 files changed, 3 insertions(+) diff --git a/source/graphics/monitor.h b/source/graphics/monitor.h index 18586db..35abce1 100644 --- a/source/graphics/monitor.h +++ b/source/graphics/monitor.h @@ -11,6 +11,7 @@ namespace Graphics { struct Monitor { unsigned index; + std::string name; std::list video_modes; const VideoMode *desktop_mode; VideoRotation desktop_rotation; diff --git a/source/graphics/windows/display.cpp b/source/graphics/windows/display.cpp index fdae09e..b9388e3 100644 --- a/source/graphics/windows/display.cpp +++ b/source/graphics/windows/display.cpp @@ -26,6 +26,7 @@ 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); if(adapter_dev.StateFlags&DISPLAY_DEVICE_PRIMARY_DEVICE) diff --git a/source/graphics/x11/display.cpp b/source/graphics/x11/display.cpp index b70c9a7..8f022f7 100644 --- a/source/graphics/x11/display.cpp +++ b/source/graphics/x11/display.cpp @@ -123,6 +123,7 @@ Display::Display(const string &disp_name): monitors.push_back(Monitor()); Monitor &monitor = monitors.back(); monitor.index = monitors.size()-1; + monitor.name.assign(output->name, output->nameLen); priv->monitors.push_back(res->outputs[i]); if(crtc) -- 2.45.2