dwindle: fix openingon, kind of

This commit is contained in:
vaxerski 2022-03-22 22:04:35 +01:00
parent e6fcbf576c
commit 53388ad8a4
1 changed files with 4 additions and 8 deletions

View File

@ -127,8 +127,10 @@ void CHyprDwindleLayout::onWindowCreated(CWindow* pWindow) {
PNODE->isNode = false;
PNODE->layout = this;
SDwindleNodeData* OPENINGON = getNodeFromWindow(g_pCompositor->vectorToWindowTiled(g_pInputManager->getMouseCoordsInternal()));
// if it's the first, it's easy. Make it fullscreen.
if (getNodesOnWorkspace(PNODE->workspaceID) == 1) {
if (!OPENINGON) {
PNODE->position = PMONITOR->vecPosition + PMONITOR->vecReservedTopLeft;
PNODE->size = PMONITOR->vecSize - PMONITOR->vecReservedTopLeft - PMONITOR->vecReservedBottomRight;
@ -136,14 +138,8 @@ void CHyprDwindleLayout::onWindowCreated(CWindow* pWindow) {
return;
}
// If it's not, get the node under our cursor
SDwindleNodeData* OPENINGON = getNodeFromWindow(g_pCompositor->vectorToWindowTiled(g_pInputManager->getMouseCoordsInternal()));
if (!OPENINGON) {
Debug::log(ERR, "OPENINGON null?????");
return;
}
m_lDwindleNodesData.push_back(SDwindleNodeData());
const auto NEWPARENT = &m_lDwindleNodesData.back();