From e87227e00ae350adebafd2adde95a47e1f68cb3a Mon Sep 17 00:00:00 2001 From: eriedaberrie <64395218+eriedaberrie@users.noreply.github.com> Date: Thu, 25 Apr 2024 14:07:50 -0700 Subject: config: Default unconfigured monitors to open to the right (#5741) * config: default unconfigured monitors to open to the right * monitor: improve logging for auto positioning --- src/config/ConfigManager.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/config/ConfigManager.cpp') diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index 4b5bbbf7..587d8c82 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -966,7 +966,11 @@ SMonitorRule CConfigManager::getMonitorRuleFor(const CMonitor& PMONITOR) { Debug::log(WARN, "No rules configured. Using the default hardcoded one."); - return SMonitorRule{.name = "", .resolution = Vector2D(0, 0), .offset = Vector2D(-INT32_MAX, -INT32_MAX), .scale = -1}; // 0, 0 is preferred and -1, -1 is auto + return SMonitorRule{.autoDir = eAutoDirs::DIR_AUTO_RIGHT, + .name = "", + .resolution = Vector2D(0, 0), + .offset = Vector2D(-INT32_MAX, -INT32_MAX), + .scale = -1}; // 0, 0 is preferred and -1, -1 is auto } SWorkspaceRule CConfigManager::getWorkspaceRuleFor(PHLWORKSPACE pWorkspace) { @@ -1655,7 +1659,12 @@ std::optional CConfigManager::handleMonitor(const std::string& comm newrule.autoDir = eAutoDirs::DIR_AUTO_UP; else if (ARGS[2] == "auto-down") newrule.autoDir = eAutoDirs::DIR_AUTO_DOWN; - + else { + Debug::log(WARN, + "Invalid auto direction. Valid options are 'auto'," + "'auto-up', 'auto-down', 'auto-left', and 'auto-right'."); + error += "invalid auto direction "; + } } else { if (!ARGS[2].contains("x")) { error += "invalid offset "; -- cgit v1.2.3