From eb1f832fcec5838053c6b031b656e4f949ada57b Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Tue, 23 May 2023 14:26:38 +0200 Subject: [PATCH] decos: recalc on add --- src/Window.hpp | 3 ++- src/layout/DwindleLayout.cpp | 2 ++ src/managers/KeybindManager.cpp | 4 ++++ src/plugins/PluginAPI.cpp | 3 +++ 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/Window.hpp b/src/Window.hpp index 3dbcbe5b..78f60721 100644 --- a/src/Window.hpp +++ b/src/Window.hpp @@ -10,7 +10,8 @@ #include "helpers/Vector2D.hpp" #include "helpers/WLSurface.hpp" -enum eIdleInhibitMode { +enum eIdleInhibitMode +{ IDLEINHIBIT_NONE = 0, IDLEINHIBIT_ALWAYS, IDLEINHIBIT_FULLSCREEN, diff --git a/src/layout/DwindleLayout.cpp b/src/layout/DwindleLayout.cpp index a1b7d6d7..523283ec 100644 --- a/src/layout/DwindleLayout.cpp +++ b/src/layout/DwindleLayout.cpp @@ -316,6 +316,8 @@ void CHyprDwindleLayout::onWindowCreatedTiling(CWindow* pWindow) { OPENINGON->pWindow->insertWindowToGroup(pWindow); pWindow->m_dWindowDecorations.emplace_back(std::make_unique(pWindow)); + pWindow->updateWindowDecos(); + recalculateWindow(pWindow); return; } diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp index 8dad6700..e3e56ef7 100644 --- a/src/managers/KeybindManager.cpp +++ b/src/managers/KeybindManager.cpp @@ -1165,6 +1165,7 @@ void CKeybindManager::toggleGroup(std::string args) { PWINDOW->m_dWindowDecorations.emplace_back(std::make_unique(PWINDOW)); PWINDOW->updateWindowDecos(); + g_pLayoutManager->getCurrentLayout()->recalculateWindow(PWINDOW); } else { if (PWINDOW->m_sGroupData.pNextWindow == PWINDOW) { PWINDOW->m_sGroupData.pNextWindow = nullptr; @@ -1999,6 +2000,9 @@ void CKeybindManager::moveIntoGroup(std::string args) { PWINDOWINDIR->insertWindowToGroup(PWINDOW); PWINDOW->m_dWindowDecorations.emplace_back(std::make_unique(PWINDOW)); + + PWINDOW->updateWindowDecos(); + g_pLayoutManager->getCurrentLayout()->recalculateWindow(PWINDOW); } void CKeybindManager::moveOutOfGroup(std::string args) { diff --git a/src/plugins/PluginAPI.cpp b/src/plugins/PluginAPI.cpp index 48500ee4..add2b833 100644 --- a/src/plugins/PluginAPI.cpp +++ b/src/plugins/PluginAPI.cpp @@ -120,6 +120,9 @@ APICALL bool HyprlandAPI::addWindowDecoration(HANDLE handle, CWindow* pWindow, I pWindow->m_dWindowDecorations.emplace_back(pDecoration); + pWindow->updateWindowDecos(); + g_pLayoutManager->getCurrentLayout()->recalculateWindow(pWindow); + return true; }