aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorVaxry <[email protected]>2023-11-11 14:52:27 +0000
committerVaxry <[email protected]>2023-11-11 14:52:27 +0000
commitcc04b52ce1f056817df5a1395ebc65fed7b9161f (patch)
tree9a8bfba8a4ef3ea99758f1b6a24778ce8b7f2643
parent9b5e2e71e0a334c722cc501c000ab12a80696c10 (diff)
downloadHyprland-cc04b52ce1f056817df5a1395ebc65fed7b9161f.tar.gz
Hyprland-cc04b52ce1f056817df5a1395ebc65fed7b9161f.zip
deco-positioner: recalc after uncache
-rw-r--r--src/render/decorations/DecorationPositioner.cpp3
-rw-r--r--src/render/decorations/DecorationPositioner.hpp1
2 files changed, 4 insertions, 0 deletions
diff --git a/src/render/decorations/DecorationPositioner.cpp b/src/render/decorations/DecorationPositioner.cpp
index 5a8a4275..98627d4c 100644
--- a/src/render/decorations/DecorationPositioner.cpp
+++ b/src/render/decorations/DecorationPositioner.cpp
@@ -52,6 +52,7 @@ Vector2D CDecorationPositioner::getEdgeDefinedPoint(uint32_t edges, CWindow* pWi
void CDecorationPositioner::uncacheDecoration(IHyprWindowDecoration* deco) {
std::erase_if(m_vWindowPositioningDatas, [&](const auto& data) { return data->pDecoration == deco; });
+ m_mWindowDatas[deco->m_pWindow].needsRecalc = true;
}
void CDecorationPositioner::repositionDeco(IHyprWindowDecoration* deco) {
@@ -88,10 +89,12 @@ void CDecorationPositioner::onWindowUpdate(CWindow* pWindow) {
&&
std::all_of(m_vWindowPositioningDatas.begin(), m_vWindowPositioningDatas.end(), [pWindow](const auto& data) { return pWindow != data->pWindow || !data->needsReposition; })
/* all window datas are either not for this window or don't need a reposition */
+ && !WINDOWDATA->needsRecalc /* window doesn't need recalc */
)
return;
WINDOWDATA->lastWindowSize = pWindow->m_vRealSize.vec();
+ WINDOWDATA->needsRecalc = false;
const bool EPHEMERAL = pWindow->m_vRealSize.isBeingAnimated();
std::sort(datas.begin(), datas.end(), [](const auto& a, const auto& b) { return a->positioningInfo.priority > b->positioningInfo.priority; });
diff --git a/src/render/decorations/DecorationPositioner.hpp b/src/render/decorations/DecorationPositioner.hpp
index c85bc217..9fc45ba3 100644
--- a/src/render/decorations/DecorationPositioner.hpp
+++ b/src/render/decorations/DecorationPositioner.hpp
@@ -84,6 +84,7 @@ class CDecorationPositioner {
Vector2D lastWindowSize = {};
SWindowDecorationExtents reserved = {};
SWindowDecorationExtents extents = {};
+ bool needsRecalc = false;
};
std::unordered_map<CWindow*, SWindowData> m_mWindowDatas;