diff options
| author | eriedaberrie <64395218+eriedaberrie@users.noreply.github.com> | 2024-04-25 14:07:50 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-25 22:07:50 +0100 |
| commit | e87227e00ae350adebafd2adde95a47e1f68cb3a (patch) | |
| tree | e0b8ce1700bd51d490beb9c5dea794a54f140ce0 /src/config | |
| parent | faa9017043e5471863646fdfd3b4a0404ff69d4c (diff) | |
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
Diffstat (limited to 'src/config')
| -rw-r--r-- | src/config/ConfigManager.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
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<std::string> 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 "; |
