aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/layout/DwindleLayout.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/layout/DwindleLayout.cpp')
-rw-r--r--src/layout/DwindleLayout.cpp21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/layout/DwindleLayout.cpp b/src/layout/DwindleLayout.cpp
index 5c5e8be0..e700e399 100644
--- a/src/layout/DwindleLayout.cpp
+++ b/src/layout/DwindleLayout.cpp
@@ -226,7 +226,7 @@ void CHyprDwindleLayout::applyNodeDataToWindow(SDwindleNodeData* pNode, bool for
PWINDOW->updateWindowDecos();
}
-void CHyprDwindleLayout::onWindowCreatedTiling(CWindow* pWindow) {
+void CHyprDwindleLayout::onWindowCreatedTiling(CWindow* pWindow, eDirection direction) {
if (pWindow->m_bIsFloating)
return;
@@ -238,6 +238,9 @@ void CHyprDwindleLayout::onWindowCreatedTiling(CWindow* pWindow) {
static auto* const PUSEACTIVE = &g_pConfigManager->getConfigValuePtr("dwindle:use_active_for_splits")->intValue;
static auto* const PDEFAULTSPLIT = &g_pConfigManager->getConfigValuePtr("dwindle:default_split_ratio")->floatValue;
+ if (direction != DIRECTION_DEFAULT && overrideDirection == DIRECTION_DEFAULT)
+ overrideDirection = direction;
+
// Populate the node with our window's data
PNODE->workspaceID = pWindow->m_iWorkspaceID;
PNODE->pWindow = pWindow;
@@ -297,7 +300,7 @@ void CHyprDwindleLayout::onWindowCreatedTiling(CWindow* pWindow) {
// last fail-safe to avoid duplicate fullscreens
if ((!OPENINGON || OPENINGON->pWindow == pWindow) && getNodesOnWorkspace(PNODE->workspaceID) > 1) {
for (auto& node : m_lDwindleNodesData) {
- if (node.workspaceID == PNODE->workspaceID && node.pWindow != pWindow) {
+ if (node.workspaceID == PNODE->workspaceID && node.pWindow != nullptr && node.pWindow != pWindow) {
OPENINGON = &node;
break;
}
@@ -372,7 +375,7 @@ void CHyprDwindleLayout::onWindowCreatedTiling(CWindow* pWindow) {
bool verticalOverride = false;
// let user select position -> top, right, bottom, left
- if (overrideDirection != OneTimeFocus::NOFOCUS) {
+ if (overrideDirection != DIRECTION_DEFAULT) {
// this is horizontal
if (overrideDirection % 2 == 0)
@@ -391,7 +394,7 @@ void CHyprDwindleLayout::onWindowCreatedTiling(CWindow* pWindow) {
// whether or not the override persists after opening one window
if (*PERMANENTDIRECTIONOVERRIDE == 0)
- overrideDirection = OneTimeFocus::NOFOCUS;
+ overrideDirection = DIRECTION_DEFAULT;
} else if (*PSMARTSPLIT == 1) {
const auto tl = NEWPARENT->position;
const auto tr = NEWPARENT->position + Vector2D(NEWPARENT->size.x, 0);
@@ -994,26 +997,26 @@ std::any CHyprDwindleLayout::layoutMessage(SLayoutMessageHeader header, std::str
switch (direction.front()) {
case 'u':
case 't': {
- overrideDirection = OneTimeFocus::UP;
+ overrideDirection = DIRECTION_UP;
break;
}
case 'd':
case 'b': {
- overrideDirection = OneTimeFocus::DOWN;
+ overrideDirection = DIRECTION_DOWN;
break;
}
case 'r': {
- overrideDirection = OneTimeFocus::RIGHT;
+ overrideDirection = DIRECTION_RIGHT;
break;
}
case 'l': {
- overrideDirection = OneTimeFocus::LEFT;
+ overrideDirection = DIRECTION_LEFT;
break;
}
default: {
// any other character resets the focus direction
// needed for the persistent mode
- overrideDirection = OneTimeFocus::NOFOCUS;
+ overrideDirection = DIRECTION_DEFAULT;
break;
}
}