summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2022-07-16 23:24:42 +0200
committervaxerski <43317083+vaxerski@users.noreply.github.com>2022-07-16 23:24:42 +0200
commit6f1b9d6af97a15f4ee13a137924d22cb98d2a855 (patch)
treeb4a57fe2fbf88452f0bb2aa761b54326172a090d /src
parent1848086abd134747eda885392f9ec8ad4efe317c (diff)
add master:new_on_top
Diffstat (limited to 'src')
-rw-r--r--src/config/ConfigManager.cpp1
-rw-r--r--src/layout/MasterLayout.cpp4
2 files changed, 4 insertions, 1 deletions
diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp
index dc2d3d48..6ca263ee 100644
--- a/src/config/ConfigManager.cpp
+++ b/src/config/ConfigManager.cpp
@@ -84,6 +84,7 @@ void CConfigManager::setDefaultVars() {
configValues["master:special_scale_factor"].floatValue = 0.8f;
configValues["master:new_is_master"].intValue = 1;
+ configValues["master:new_on_top"].intValue = 0;
configValues["animations:enabled"].intValue = 1;
configValues["animations:speed"].floatValue = 7.f;
diff --git a/src/layout/MasterLayout.cpp b/src/layout/MasterLayout.cpp
index f88ee08f..02b27598 100644
--- a/src/layout/MasterLayout.cpp
+++ b/src/layout/MasterLayout.cpp
@@ -37,7 +37,9 @@ void CHyprMasterLayout::onWindowCreatedTiling(CWindow* pWindow) {
if (pWindow->m_bIsFloating)
return;
- const auto PNODE = &m_lMasterNodesData.emplace_back();
+ static auto *const PNEWTOP = &g_pConfigManager->getConfigValuePtr("master:new_on_top")->intValue;
+
+ const auto PNODE = *PNEWTOP ? &m_lMasterNodesData.emplace_front() : &m_lMasterNodesData.emplace_back();
PNODE->workspaceID = pWindow->m_iWorkspaceID;
PNODE->pWindow = pWindow;