summaryrefslogtreecommitdiff
path: root/src/helpers/SubsurfaceTree.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/helpers/SubsurfaceTree.cpp')
-rw-r--r--src/helpers/SubsurfaceTree.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/helpers/SubsurfaceTree.cpp b/src/helpers/SubsurfaceTree.cpp
index c10d45e1..5891411b 100644
--- a/src/helpers/SubsurfaceTree.cpp
+++ b/src/helpers/SubsurfaceTree.cpp
@@ -220,6 +220,8 @@ void Events::listener_commitSubsurface(void* owner, void* data) {
// no damaging if it's not visible
if (!g_pHyprRenderer->shouldRenderWindow(pNode->pWindowOwner)) {
+ pNode->lastSize = pNode->pSurface->exists() ? Vector2D{pNode->pSurface->wlr()->current.width, pNode->pSurface->wlr()->current.height} : Vector2D{};
+
static auto* const PLOGDAMAGE = &g_pConfigManager->getConfigValuePtr("debug:log_damage")->intValue;
if (*PLOGDAMAGE)
Debug::log(LOG, "Refusing to commit damage from {} because it's invisible.", pNode->pWindowOwner);
@@ -244,9 +246,13 @@ void Events::listener_commitSubsurface(void* owner, void* data) {
}
}
- if (pNode->pSurface && pNode->pSurface->exists())
+ if (pNode->pSurface && pNode->pSurface->exists()) {
g_pHyprRenderer->damageSurface(pNode->pSurface->wlr(), lx, ly, SCALE);
+ if (pNode->lastSize != Vector2D{pNode->pSurface->wlr()->current.width, pNode->pSurface->wlr()->current.height} && pNode->pWindowOwner)
+ g_pHyprRenderer->damageWindow(pNode->pWindowOwner);
+ }
+
if (pNode->pWindowOwner) {
if (pNode->pWindowOwner->m_bIsX11)
pNode->pWindowOwner->m_vReportedSize = pNode->pWindowOwner->m_vPendingReportedSize; // apply pending size. We pinged, the window ponged.
@@ -269,6 +275,8 @@ void Events::listener_commitSubsurface(void* owner, void* data) {
}
}
}
+
+ pNode->lastSize = pNode->pSurface->exists() ? Vector2D{pNode->pSurface->wlr()->current.width, pNode->pSurface->wlr()->current.height} : Vector2D{};
}
void Events::listener_destroySubsurface(void* owner, void* data) {