mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-09 23:45:58 +01:00
parent
b99ac063ea
commit
d9f7f039e1
3 changed files with 17 additions and 3 deletions
|
@ -499,6 +499,16 @@ CMonitor* CCompositor::getMonitorFromName(const std::string& name) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CMonitor* CCompositor::getMonitorFromDesc(const std::string& desc) {
|
||||||
|
for (auto& m : m_vMonitors) {
|
||||||
|
if (desc == m->output->description) {
|
||||||
|
return m.get();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
CMonitor* CCompositor::getMonitorFromCursor() {
|
CMonitor* CCompositor::getMonitorFromCursor() {
|
||||||
const auto COORDS = Vector2D(m_sWLRCursor->x, m_sWLRCursor->y);
|
const auto COORDS = Vector2D(m_sWLRCursor->x, m_sWLRCursor->y);
|
||||||
|
|
||||||
|
|
|
@ -28,8 +28,7 @@
|
||||||
#include "hyprerror/HyprError.hpp"
|
#include "hyprerror/HyprError.hpp"
|
||||||
#include "plugins/PluginSystem.hpp"
|
#include "plugins/PluginSystem.hpp"
|
||||||
|
|
||||||
enum eManagersInitStage
|
enum eManagersInitStage {
|
||||||
{
|
|
||||||
STAGE_PRIORITY = 0,
|
STAGE_PRIORITY = 0,
|
||||||
STAGE_LATE
|
STAGE_LATE
|
||||||
};
|
};
|
||||||
|
@ -125,6 +124,7 @@ class CCompositor {
|
||||||
|
|
||||||
CMonitor* getMonitorFromID(const int&);
|
CMonitor* getMonitorFromID(const int&);
|
||||||
CMonitor* getMonitorFromName(const std::string&);
|
CMonitor* getMonitorFromName(const std::string&);
|
||||||
|
CMonitor* getMonitorFromDesc(const std::string&);
|
||||||
CMonitor* getMonitorFromCursor();
|
CMonitor* getMonitorFromCursor();
|
||||||
CMonitor* getMonitorFromVector(const Vector2D&);
|
CMonitor* getMonitorFromVector(const Vector2D&);
|
||||||
void removeWindowFromVectorSafe(CWindow*);
|
void removeWindowFromVectorSafe(CWindow*);
|
||||||
|
|
|
@ -2106,7 +2106,11 @@ void CConfigManager::addParseError(const std::string& err) {
|
||||||
}
|
}
|
||||||
|
|
||||||
CMonitor* CConfigManager::getBoundMonitorForWS(const std::string& wsname) {
|
CMonitor* CConfigManager::getBoundMonitorForWS(const std::string& wsname) {
|
||||||
return g_pCompositor->getMonitorFromName(getBoundMonitorStringForWS(wsname));
|
auto monitor = getBoundMonitorStringForWS(wsname);
|
||||||
|
if (monitor.substr(0, 5) == "desc:")
|
||||||
|
return g_pCompositor->getMonitorFromDesc(monitor.substr(5));
|
||||||
|
else
|
||||||
|
return g_pCompositor->getMonitorFromName(monitor);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string CConfigManager::getBoundMonitorStringForWS(const std::string& wsname) {
|
std::string CConfigManager::getBoundMonitorStringForWS(const std::string& wsname) {
|
||||||
|
|
Loading…
Reference in a new issue