aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorthejch <[email protected]>2024-04-01 08:21:45 -0700
committerGitHub <[email protected]>2024-04-01 16:21:45 +0100
commit7513c0cea59f4e1f5336dc31ebfabd8362e02d69 (patch)
tree4c4f500c51249ab18768835a5f3c43940ee99122
parent800dbf71b0db04bf43ff5a87a9cff6e48de325a2 (diff)
downloadHyprland-7513c0cea59f4e1f5336dc31ebfabd8362e02d69.tar.gz
Hyprland-7513c0cea59f4e1f5336dc31ebfabd8362e02d69.zip
renderer: Fix layer and window damage sometimes missing 1 frame (#5370)
* fix the layer and window damage missing 1 frame sometimes * remove extra loop
-rw-r--r--src/managers/AnimationManager.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/managers/AnimationManager.cpp b/src/managers/AnimationManager.cpp
index fc768b77..6cc89cde 100644
--- a/src/managers/AnimationManager.cpp
+++ b/src/managers/AnimationManager.cpp
@@ -85,7 +85,6 @@ void CAnimationManager::tick() {
CMonitor* PMONITOR = nullptr;
bool animationsDisabled = animGlobalDisabled;
- CBox WLRBOXPREV = {0, 0, 0, 0};
if (PWINDOW) {
if (av->m_eDamagePolicy == AVARDAMAGE_ENTIRE) {
g_pHyprRenderer->damageWindow(PWINDOW);
@@ -136,8 +135,12 @@ void CAnimationManager::tick() {
g_pHyprRenderer->damageWindow(w.get());
}
} else if (PLAYER) {
- WLRBOXPREV = CBox{PLAYER->realPosition.value(), PLAYER->realSize.value()};
- PMONITOR = g_pCompositor->getMonitorFromVector(Vector2D(PLAYER->geometry.x, PLAYER->geometry.y) + Vector2D(PLAYER->geometry.width, PLAYER->geometry.height) / 2.f);
+ // "some fucking layers miss 1 pixel???" -- vaxry
+ CBox expandBox = CBox{PLAYER->realPosition.value(), PLAYER->realSize.value()};
+ expandBox.expand(5);
+ g_pHyprRenderer->damageBox(&expandBox);
+
+ PMONITOR = g_pCompositor->getMonitorFromVector(Vector2D(PLAYER->geometry.x, PLAYER->geometry.y) + Vector2D(PLAYER->geometry.width, PLAYER->geometry.height) / 2.f);
if (!PMONITOR)
continue;
animationsDisabled = animationsDisabled || PLAYER->noAnimations;
@@ -204,8 +207,6 @@ void CAnimationManager::tick() {
switch (av->m_eDamagePolicy) {
case AVARDAMAGE_ENTIRE: {
- g_pHyprRenderer->damageBox(&WLRBOXPREV);
-
if (PWINDOW) {
PWINDOW->updateWindowDecos();
g_pHyprRenderer->damageWindow(PWINDOW);
@@ -215,13 +216,17 @@ void CAnimationManager::tick() {
continue;
w->updateWindowDecos();
+
+ // damage any workspace window that is on any monitor
+ if (!w->m_bPinned)
+ g_pHyprRenderer->damageWindow(w.get());
}
} else if (PLAYER) {
if (PLAYER->layer == ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND || PLAYER->layer == ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM)
g_pHyprOpenGL->markBlurDirtyForMonitor(PMONITOR);
// some fucking layers miss 1 pixel???
- CBox expandBox = WLRBOXPREV;
+ CBox expandBox = CBox{PLAYER->realPosition.value(), PLAYER->realSize.value()};
expandBox.expand(5);
g_pHyprRenderer->damageBox(&expandBox);
}