From 9fcef41d6653a2541a06275d0843bb61aaf5ea1b Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Tue, 28 Jun 2022 15:30:46 +0200 Subject: mutliple fixes to subsurface handling --- src/helpers/SubsurfaceTree.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/helpers/SubsurfaceTree.cpp') diff --git a/src/helpers/SubsurfaceTree.cpp b/src/helpers/SubsurfaceTree.cpp index bcff2986..c511b900 100644 --- a/src/helpers/SubsurfaceTree.cpp +++ b/src/helpers/SubsurfaceTree.cpp @@ -193,12 +193,22 @@ void Events::listener_commitSubsurface(void* owner, void* data) { Debug::log(LOG, "Refusing to commit damage from %x because it's invisible.", pNode->pWindowOwner); return; } - int lx = 0, ly = 0; addSurfaceGlobalOffset(pNode, &lx, &ly); + // I do not think this is correct, but it solves a lot of issues with some apps (e.g. firefox) + // What this does is that basically, if the pNode is a child of some other node, on commit, + // it will also damage (check & damage if needed) all its siblings. + if (pNode->pParent) for (auto& cs : pNode->pParent->childSubsurfaces) { + const auto NODECOORDS = pNode->pSubsurface ? Vector2D(pNode->pSubsurface->pSubsurface->current.x, pNode->pSubsurface->pSubsurface->current.y) : Vector2D(); + + if (&cs != pNode->pSubsurface && cs.pSubsurface) { + g_pHyprRenderer->damageSurface(cs.pSubsurface->surface, lx - NODECOORDS.x + cs.pSubsurface->current.x, ly - NODECOORDS.y + cs.pSubsurface->current.y); + } + } + g_pHyprRenderer->damageSurface(pNode->pSurface, lx, ly); } -- cgit v1.2.3