summaryrefslogtreecommitdiff
path: root/src/layout/MasterLayout.cpp
diff options
context:
space:
mode:
authorVaxry <vaxry@vaxry.net>2023-12-11 22:58:40 +0000
committerVaxry <vaxry@vaxry.net>2023-12-11 22:58:51 +0000
commitea7569d7e0941d19f5f469a5fbb79bc0fa62b935 (patch)
tree66cbdeb4cea529b9226f64d3fd4a911f3a1bffbc /src/layout/MasterLayout.cpp
parente53134ca904e47a24191ea028c019ac9728b7dad (diff)
config: improve layoutopt handling for workspacerules
Diffstat (limited to 'src/layout/MasterLayout.cpp')
-rw-r--r--src/layout/MasterLayout.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/layout/MasterLayout.cpp b/src/layout/MasterLayout.cpp
index 8b12d669..ff7f9e2e 100644
--- a/src/layout/MasterLayout.cpp
+++ b/src/layout/MasterLayout.cpp
@@ -45,10 +45,8 @@ SMasterWorkspaceData* CHyprMasterLayout::getMasterWorkspaceData(const int& ws) {
const auto layoutoptsForWs = g_pConfigManager->getWorkspaceRuleFor(g_pCompositor->getWorkspaceByID(ws)).layoutopts;
auto orientationForWs = *orientation;
- try {
- if (layoutoptsForWs.contains("orientation"))
- orientationForWs = std::any_cast<std::string>(layoutoptsForWs.at("orientation"));
- } catch (std::exception& e) { Debug::log(ERR, "Error from layoutopt rules: {}", e.what()); }
+ if (layoutoptsForWs.contains("orientation"))
+ orientationForWs = layoutoptsForWs.at("orientation");
if (orientationForWs == "top") {
PWORKSPACEDATA->orientation = ORIENTATION_TOP;
@@ -56,11 +54,12 @@ SMasterWorkspaceData* CHyprMasterLayout::getMasterWorkspaceData(const int& ws) {
PWORKSPACEDATA->orientation = ORIENTATION_RIGHT;
} else if (orientationForWs == "bottom") {
PWORKSPACEDATA->orientation = ORIENTATION_BOTTOM;
- } else if (orientationForWs == "left") {
- PWORKSPACEDATA->orientation = ORIENTATION_LEFT;
- } else {
+ } else if (orientationForWs == "center") {
PWORKSPACEDATA->orientation = ORIENTATION_CENTER;
+ } else {
+ PWORKSPACEDATA->orientation = ORIENTATION_LEFT;
}
+
return PWORKSPACEDATA;
}