From c3ec16f494f52dfd670cfd4d4296ddda662f039b Mon Sep 17 00:00:00 2001 From: Gabriel Ford Date: Tue, 23 Apr 2024 00:40:03 +0000 Subject: config: Add More Monitor 'Auto' Positions. (#5670) * Reverse Window Positioning. * Cleanup old comments and logs. * Finish Splitting Left and Right offset. * Forgot to add Auto Left to ConfigManager * Fix problems with auto_left. * Nearly finish up and down. * Finish draft of all four dirs. Testing now. * Change Y value in moveTo for up and down. * Format, comment, and cleanup. * Address Vaxry's feedback. * Add check to see if auto position is first rule. * Run clang-format. --- src/config/ConfigManager.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/config/ConfigManager.cpp') diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index eaaed1f7..dda56530 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -1642,6 +1642,16 @@ std::optional CConfigManager::handleMonitor(const std::string& comm if (ARGS[2].starts_with("auto")) { newrule.offset = Vector2D(-INT32_MAX, -INT32_MAX); + // If this is the first monitor rule needs to be on the right. + if (ARGS[2] == "auto-right" || ARGS[2] == "auto" || m_dMonitorRules.empty()) + newrule.autoDir = eAutoDirs::DIR_AUTO_RIGHT; + else if (ARGS[2] == "auto-left") + newrule.autoDir = eAutoDirs::DIR_AUTO_LEFT; + else if (ARGS[2] == "auto-up") + newrule.autoDir = eAutoDirs::DIR_AUTO_UP; + else if (ARGS[2] == "auto-down") + newrule.autoDir = eAutoDirs::DIR_AUTO_DOWN; + } else { if (!ARGS[2].contains("x")) { error += "invalid offset "; -- cgit v1.2.3