aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Compositor.cpp
diff options
context:
space:
mode:
authorvaxerski <[email protected]>2022-05-29 20:15:34 +0200
committervaxerski <[email protected]>2022-05-29 20:15:34 +0200
commitb76b32b458ab6e67632a110758ac5fe6e3701948 (patch)
tree33f55ff4e9080754f1d706f404066030b89be33c /src/Compositor.cpp
parentf5645805d8db9e6d45dd4d82bff12054b3b81180 (diff)
downloadHyprland-b76b32b458ab6e67632a110758ac5fe6e3701948.tar.gz
Hyprland-b76b32b458ab6e67632a110758ac5fe6e3701948.zip
don't add existing and invalid monitors
Diffstat (limited to 'src/Compositor.cpp')
-rw-r--r--src/Compositor.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/Compositor.cpp b/src/Compositor.cpp
index 49844286..29e2f188 100644
--- a/src/Compositor.cpp
+++ b/src/Compositor.cpp
@@ -255,6 +255,16 @@ SMonitor* CCompositor::getMonitorFromID(const int& id) {
return nullptr;
}
+SMonitor* CCompositor::getMonitorFromName(const std::string& name) {
+ for (auto& m : m_lMonitors) {
+ if (m.szName == name) {
+ return &m;
+ }
+ }
+
+ return nullptr;
+}
+
SMonitor* CCompositor::getMonitorFromCursor() {
const auto COORDS = Vector2D(m_sWLRCursor->x, m_sWLRCursor->y);