summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2023-05-24 19:23:07 +0200
committervaxerski <43317083+vaxerski@users.noreply.github.com>2023-05-24 19:23:10 +0200
commita4c120d6081ee35b7997afdec451480048242d06 (patch)
tree5f7927eb005721b209753632c873bbfc95a035f1 /src
parent53285a75ad4fbc68269a71ed24a41fe60164b047 (diff)
layouts: ignore direction forces on non-map
Diffstat (limited to 'src')
-rw-r--r--src/Window.hpp2
-rw-r--r--src/events/Windows.cpp3
-rw-r--r--src/layout/DwindleLayout.cpp2
-rw-r--r--src/layout/MasterLayout.cpp2
4 files changed, 6 insertions, 3 deletions
diff --git a/src/Window.hpp b/src/Window.hpp
index 78f60721..164c5ee2 100644
--- a/src/Window.hpp
+++ b/src/Window.hpp
@@ -189,7 +189,7 @@ class CWindow {
bool m_bIsPseudotiled = false;
Vector2D m_vPseudoSize = Vector2D(0, 0);
- uint64_t m_iTags = 0;
+ bool m_bFirstMap = false; // for layouts
bool m_bIsFloating = false;
bool m_bDraggingTiled = false; // for dragging around tiled windows
bool m_bIsFullscreen = false;
diff --git a/src/events/Windows.cpp b/src/events/Windows.cpp
index 05ef8daf..d9230f8a 100644
--- a/src/events/Windows.cpp
+++ b/src/events/Windows.cpp
@@ -58,6 +58,7 @@ void Events::listener_mapWindow(void* owner, void* data) {
PWINDOW->m_bFadingOut = false;
PWINDOW->m_szTitle = g_pXWaylandManager->getTitle(PWINDOW);
PWINDOW->m_iX11Type = PWINDOW->m_bIsX11 ? (PWINDOW->m_uSurface.xwayland->override_redirect ? 2 : 1) : 1;
+ PWINDOW->m_bFirstMap = true;
if (g_pInputManager->m_bLastFocusOnLS) // waybar fix
g_pInputManager->releaseAllMouseButtons();
@@ -584,6 +585,8 @@ void Events::listener_mapWindow(void* owner, void* data) {
}
}
+ PWINDOW->m_bFirstMap = false;
+
Debug::log(LOG, "Map request dispatched, monitor %s, xywh: %f %f %f %f", PMONITOR->szName.c_str(), PWINDOW->m_vRealPosition.goalv().x, PWINDOW->m_vRealPosition.goalv().y,
PWINDOW->m_vRealSize.goalv().x, PWINDOW->m_vRealSize.goalv().y);
diff --git a/src/layout/DwindleLayout.cpp b/src/layout/DwindleLayout.cpp
index 523283ec..f433c573 100644
--- a/src/layout/DwindleLayout.cpp
+++ b/src/layout/DwindleLayout.cpp
@@ -371,7 +371,7 @@ void CHyprDwindleLayout::onWindowCreatedTiling(CWindow* pWindow) {
if (*PERMANENTDIRECTIONOVERRIDE == 0)
overrideDirection = OneTimeFocus::NOFOCUS;
- } else if (*PFORCESPLIT == 0) {
+ } else if (*PFORCESPLIT == 0 || !pWindow->m_bFirstMap) {
if ((SIDEBYSIDE &&
VECINRECT(MOUSECOORDS, NEWPARENT->position.x, NEWPARENT->position.y / *PWIDTHMULTIPLIER, NEWPARENT->position.x + NEWPARENT->size.x / 2.f,
NEWPARENT->position.y + NEWPARENT->size.y)) ||
diff --git a/src/layout/MasterLayout.cpp b/src/layout/MasterLayout.cpp
index 66fb6eb0..fcd8c900 100644
--- a/src/layout/MasterLayout.cpp
+++ b/src/layout/MasterLayout.cpp
@@ -101,7 +101,7 @@ void CHyprMasterLayout::onWindowCreatedTiling(CWindow* pWindow) {
return;
}
- if (*PNEWISMASTER || WINDOWSONWORKSPACE == 1) {
+ if (*PNEWISMASTER || WINDOWSONWORKSPACE == 1 || (!pWindow->m_bFirstMap && OPENINGON->isMaster)) {
for (auto& nd : m_lMasterNodesData) {
if (nd.isMaster && nd.workspaceID == PNODE->workspaceID) {
nd.isMaster = false;