mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-26 07:05:58 +01:00
windowrules: allow monitor by str
This commit is contained in:
parent
e5ad53ac42
commit
6e6971606d
1 changed files with 15 additions and 5 deletions
|
@ -125,11 +125,21 @@ void Events::listener_mapWindow(void* owner, void* data) {
|
||||||
if (MONITORSTR == "unset") {
|
if (MONITORSTR == "unset") {
|
||||||
PWINDOW->m_iMonitorID = PMONITOR->ID;
|
PWINDOW->m_iMonitorID = PMONITOR->ID;
|
||||||
} else {
|
} else {
|
||||||
const long int MONITOR = std::stoi(MONITORSTR);
|
if (isNumber(MONITORSTR)) {
|
||||||
if (!g_pCompositor->getMonitorFromID(MONITOR))
|
const long int MONITOR = std::stoi(MONITORSTR);
|
||||||
PWINDOW->m_iMonitorID = 0;
|
if (!g_pCompositor->getMonitorFromID(MONITOR))
|
||||||
else
|
PWINDOW->m_iMonitorID = 0;
|
||||||
PWINDOW->m_iMonitorID = MONITOR;
|
else
|
||||||
|
PWINDOW->m_iMonitorID = MONITOR;
|
||||||
|
} else {
|
||||||
|
const auto PMONITOR = g_pCompositor->getMonitorFromName(MONITORSTR);
|
||||||
|
if (PMONITOR)
|
||||||
|
PWINDOW->m_iMonitorID = PMONITOR->ID;
|
||||||
|
else {
|
||||||
|
Debug::log(ERR, "No monitor in monitor %s rule", MONITORSTR.c_str());
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PWINDOW->m_iWorkspaceID = g_pCompositor->getMonitorFromID(PWINDOW->m_iMonitorID)->activeWorkspace;
|
PWINDOW->m_iWorkspaceID = g_pCompositor->getMonitorFromID(PWINDOW->m_iMonitorID)->activeWorkspace;
|
||||||
|
|
Loading…
Reference in a new issue