summaryrefslogtreecommitdiff
path: root/src/events/Windows.cpp
diff options
context:
space:
mode:
authorItsOhen <TNordfeldt@gmail.com>2025-09-29 20:10:34 +0200
committerGitHub <noreply@github.com>2025-09-29 20:10:34 +0200
commit38c1e72c9d81fcdad8f173e06102a5da18836230 (patch)
treeaad2d03d0ab45280e313b75451a0d125be86ddaf /src/events/Windows.cpp
parent09596725910aab2a9defed250348aebeee40f842 (diff)
rules: fix some monitor rules (#11873)
Diffstat (limited to 'src/events/Windows.cpp')
-rw-r--r--src/events/Windows.cpp26
1 files changed, 10 insertions, 16 deletions
diff --git a/src/events/Windows.cpp b/src/events/Windows.cpp
index 8f40c0e1..16f71534 100644
--- a/src/events/Windows.cpp
+++ b/src/events/Windows.cpp
@@ -15,6 +15,7 @@
#include "../protocols/ToplevelExport.hpp"
#include "../protocols/types/ContentType.hpp"
#include "../xwayland/XSurface.hpp"
+#include "desktop/DesktopTypes.hpp"
#include "managers/animation/AnimationManager.hpp"
#include "managers/animation/DesktopAnimationManager.hpp"
#include "managers/PointerManager.hpp"
@@ -147,23 +148,16 @@ void Events::listener_mapWindow(void* owner, void* data) {
try {
const auto MONITORSTR = trim(r->m_rule.substr(r->m_rule.find(' ')));
- if (MONITORSTR == "unset") {
+ if (MONITORSTR == "unset")
PWINDOW->m_monitor = PMONITOR;
- } else {
- if (isNumber(MONITORSTR)) {
- const MONITORID MONITOR = std::stoi(MONITORSTR);
- if (const auto PM = g_pCompositor->getMonitorFromID(MONITOR); PM)
- PWINDOW->m_monitor = PM;
- else
- PWINDOW->m_monitor = g_pCompositor->m_monitors.at(0);
- } else {
- const auto PMONITOR = g_pCompositor->getMonitorFromName(MONITORSTR);
- if (PMONITOR)
- PWINDOW->m_monitor = PMONITOR;
- else {
- Debug::log(ERR, "No monitor in monitor {} rule", MONITORSTR);
- continue;
- }
+ else {
+ const auto MONITOR = g_pCompositor->getMonitorFromString(MONITORSTR);
+
+ if (MONITOR)
+ PWINDOW->m_monitor = MONITOR;
+ else {
+ Debug::log(ERR, "No monitor in monitor {} rule", MONITORSTR);
+ continue;
}
}