diff options
author | Vaxry <[email protected]> | 2024-08-01 12:36:09 +0200 |
---|---|---|
committer | Vaxry <[email protected]> | 2024-08-01 12:36:15 +0200 |
commit | 60571cd5ccc76f91209ef2faac93ecea542de221 (patch) | |
tree | 8bf408432c4b7b4b656d73bb58f77e2821b5c77b | |
parent | 5edfa627b4efc5d2125f4f0f97dad6bac6c3a407 (diff) | |
download | Hyprland-60571cd5ccc76f91209ef2faac93ecea542de221.tar.gz Hyprland-60571cd5ccc76f91209ef2faac93ecea542de221.zip |
border: fixup infinite recursion
ref #7127
-rw-r--r-- | src/render/decorations/CHyprBorderDecoration.cpp | 14 | ||||
-rw-r--r-- | src/render/decorations/CHyprBorderDecoration.hpp | 2 |
2 files changed, 14 insertions, 2 deletions
diff --git a/src/render/decorations/CHyprBorderDecoration.cpp b/src/render/decorations/CHyprBorderDecoration.cpp index 708215b6..ddb38c6e 100644 --- a/src/render/decorations/CHyprBorderDecoration.cpp +++ b/src/render/decorations/CHyprBorderDecoration.cpp @@ -1,6 +1,7 @@ #include "CHyprBorderDecoration.hpp" #include "../../Compositor.hpp" #include "../../config/ConfigValue.hpp" +#include "../../managers/eventLoop/EventLoopManager.hpp" CHyprBorderDecoration::CHyprBorderDecoration(PHLWINDOW pWindow) : IHyprWindowDecoration(pWindow) { m_pWindow = pWindow; @@ -82,8 +83,17 @@ eDecorationType CHyprBorderDecoration::getDecorationType() { } void CHyprBorderDecoration::updateWindow(PHLWINDOW) { - if (m_pWindow->getRealBorderSize() != m_seExtents.topLeft.x) - g_pDecorationPositioner->repositionDeco(this); + auto borderSize = m_pWindow->getRealBorderSize(); + + if (borderSize == m_iLastBorderSize) + return; + + if (borderSize <= 0 && m_iLastBorderSize <= 0) + return; + + m_iLastBorderSize = borderSize; + + g_pEventLoopManager->doLater([this]() { g_pDecorationPositioner->repositionDeco(this); }); } void CHyprBorderDecoration::damageEntire() { diff --git a/src/render/decorations/CHyprBorderDecoration.hpp b/src/render/decorations/CHyprBorderDecoration.hpp index 8ad3263e..0e196565 100644 --- a/src/render/decorations/CHyprBorderDecoration.hpp +++ b/src/render/decorations/CHyprBorderDecoration.hpp @@ -36,6 +36,8 @@ class CHyprBorderDecoration : public IHyprWindowDecoration { CBox m_bAssignedGeometry = {0}; + int m_iLastBorderSize = -1; + CBox assignedBoxGlobal(); bool doesntWantBorders(); }; |