diff options
| author | Vaxry <vaxry@vaxry.net> | 2026-04-04 19:07:39 +0100 |
|---|---|---|
| committer | Vaxry <43317083+vaxerski@users.noreply.github.com> | 2026-04-04 14:42:04 -0400 |
| commit | 9b05dc1b4c44849a3c23e67381dd7c2f311b4ee3 (patch) | |
| tree | 3dd2c5d182c693841abcf233fa4cd7bd707ad156 /src/render | |
| parent | d170a627b515a1fe6b9dea7b43e0e8afb85876f8 (diff) | |
render/decoration: cache input extents as well
Diffstat (limited to 'src/render')
| -rw-r--r-- | src/render/decorations/DecorationPositioner.cpp | 13 | ||||
| -rw-r--r-- | src/render/decorations/DecorationPositioner.hpp | 13 |
2 files changed, 12 insertions, 14 deletions
diff --git a/src/render/decorations/DecorationPositioner.cpp b/src/render/decorations/DecorationPositioner.cpp index 27da0f4a..4c373925 100644 --- a/src/render/decorations/DecorationPositioner.cpp +++ b/src/render/decorations/DecorationPositioner.cpp @@ -358,21 +358,18 @@ SBoxExtents CDecorationPositioner::computeWindowDecorationExtents(PHLWINDOWREF p } SBoxExtents CDecorationPositioner::getWindowDecorationExtents(PHLWINDOWREF pWindow, bool inputOnly) { - // inputOnly is rare (input handling), skip the cache for it - if (inputOnly) - return computeWindowDecorationExtents(pWindow, true); - const auto WIT = std::ranges::find_if(m_windowDatas, [&](const auto& other) { return other.first.lock() == pWindow; }); if (WIT == m_windowDatas.end()) - return computeWindowDecorationExtents(pWindow, false); + return computeWindowDecorationExtents(pWindow, inputOnly); auto& wd = WIT->second; if (wd.needsDamageExtents) { - wd.decorationExtents = computeWindowDecorationExtents(pWindow, false); - wd.needsDamageExtents = false; + wd.decorationExtents = computeWindowDecorationExtents(pWindow, false); + wd.decorationInputExtents = computeWindowDecorationExtents(pWindow, true); + wd.needsDamageExtents = false; } - return wd.decorationExtents; + return inputOnly ? wd.decorationInputExtents : wd.decorationExtents; } CBox CDecorationPositioner::getBoxWithIncludedDecos(PHLWINDOW pWindow) { diff --git a/src/render/decorations/DecorationPositioner.hpp b/src/render/decorations/DecorationPositioner.hpp index ccd148dd..99168c10 100644 --- a/src/render/decorations/DecorationPositioner.hpp +++ b/src/render/decorations/DecorationPositioner.hpp @@ -80,12 +80,13 @@ class CDecorationPositioner { }; struct SWindowData { - Vector2D lastWindowSize = {}; - SBoxExtents reserved = {}; - SBoxExtents extents = {}; - SBoxExtents decorationExtents = {}; - bool needsRecalc = false; - bool needsDamageExtents = true; + Vector2D lastWindowSize = {}; + SBoxExtents reserved = {}; + SBoxExtents extents = {}; + SBoxExtents decorationExtents = {}; + SBoxExtents decorationInputExtents = {}; + bool needsRecalc = false; + bool needsDamageExtents = true; }; std::map<PHLWINDOWREF, SWindowData> m_windowDatas; |
