diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-06-28 15:30:46 +0200 |
|---|---|---|
| committer | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-06-28 15:30:46 +0200 |
| commit | 9fcef41d6653a2541a06275d0843bb61aaf5ea1b (patch) | |
| tree | 48e445c505a06ff3c736a74ca32a8726782ab29f /src | |
| parent | fc5cd49795fd412be89b536bd90073dacdd5b7d8 (diff) | |
mutliple fixes to subsurface handling
Diffstat (limited to 'src')
| -rw-r--r-- | src/events/Windows.cpp | 3 | ||||
| -rw-r--r-- | src/helpers/SubsurfaceTree.cpp | 12 | ||||
| -rw-r--r-- | src/render/Renderer.cpp | 5 |
3 files changed, 17 insertions, 3 deletions
diff --git a/src/events/Windows.cpp b/src/events/Windows.cpp index 86202929..29d21f6f 100644 --- a/src/events/Windows.cpp +++ b/src/events/Windows.cpp @@ -268,8 +268,7 @@ void Events::listener_mapWindow(void* owner, void* data) { g_pCompositor->setWindowFullscreen(PWINDOW, true, FULLSCREEN_FULL); } - if (!PWINDOW->m_bIsX11) - PWINDOW->m_pSurfaceTree = SubsurfaceTree::createTreeRoot(g_pXWaylandManager->getWindowSurface(PWINDOW), addViewCoords, PWINDOW, PWINDOW); + PWINDOW->m_pSurfaceTree = SubsurfaceTree::createTreeRoot(g_pXWaylandManager->getWindowSurface(PWINDOW), addViewCoords, PWINDOW, PWINDOW); Debug::log(LOG, "Map request dispatched, monitor %s, xywh: %f %f %f %f", PMONITOR->szName.c_str(), PWINDOW->m_vRealPosition.goalv().x, PWINDOW->m_vRealPosition.goalv().y, PWINDOW->m_vRealSize.goalv().x, PWINDOW->m_vRealSize.goalv().y); } 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); } diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp index 5d167592..72a5b854 100644 --- a/src/render/Renderer.cpp +++ b/src/render/Renderer.cpp @@ -551,6 +551,11 @@ void CHyprRenderer::damageSurface(wlr_surface* pSurface, double x, double y) { pixman_region32_init(&damageBox); wlr_surface_get_effective_damage(pSurface, &damageBox); + if (!pixman_region32_not_empty(&damageBox)) { + pixman_region32_fini(&damageBox); + return; + } + pixman_region32_translate(&damageBox, x, y); for (auto& m : g_pCompositor->m_lMonitors) { |
