mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-05-19 08:30:22 -07:00
renderer: Fix layer and window damage sometimes missing 1 frame (#5370)
* fix the layer and window damage missing 1 frame sometimes * remove extra loop
This commit is contained in:
parent
800dbf71b0
commit
7513c0cea5
@ -85,7 +85,6 @@ void CAnimationManager::tick() {
|
|||||||
CMonitor* PMONITOR = nullptr;
|
CMonitor* PMONITOR = nullptr;
|
||||||
bool animationsDisabled = animGlobalDisabled;
|
bool animationsDisabled = animGlobalDisabled;
|
||||||
|
|
||||||
CBox WLRBOXPREV = {0, 0, 0, 0};
|
|
||||||
if (PWINDOW) {
|
if (PWINDOW) {
|
||||||
if (av->m_eDamagePolicy == AVARDAMAGE_ENTIRE) {
|
if (av->m_eDamagePolicy == AVARDAMAGE_ENTIRE) {
|
||||||
g_pHyprRenderer->damageWindow(PWINDOW);
|
g_pHyprRenderer->damageWindow(PWINDOW);
|
||||||
@ -136,7 +135,11 @@ void CAnimationManager::tick() {
|
|||||||
g_pHyprRenderer->damageWindow(w.get());
|
g_pHyprRenderer->damageWindow(w.get());
|
||||||
}
|
}
|
||||||
} else if (PLAYER) {
|
} else if (PLAYER) {
|
||||||
WLRBOXPREV = CBox{PLAYER->realPosition.value(), PLAYER->realSize.value()};
|
// "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);
|
PMONITOR = g_pCompositor->getMonitorFromVector(Vector2D(PLAYER->geometry.x, PLAYER->geometry.y) + Vector2D(PLAYER->geometry.width, PLAYER->geometry.height) / 2.f);
|
||||||
if (!PMONITOR)
|
if (!PMONITOR)
|
||||||
continue;
|
continue;
|
||||||
@ -204,8 +207,6 @@ void CAnimationManager::tick() {
|
|||||||
|
|
||||||
switch (av->m_eDamagePolicy) {
|
switch (av->m_eDamagePolicy) {
|
||||||
case AVARDAMAGE_ENTIRE: {
|
case AVARDAMAGE_ENTIRE: {
|
||||||
g_pHyprRenderer->damageBox(&WLRBOXPREV);
|
|
||||||
|
|
||||||
if (PWINDOW) {
|
if (PWINDOW) {
|
||||||
PWINDOW->updateWindowDecos();
|
PWINDOW->updateWindowDecos();
|
||||||
g_pHyprRenderer->damageWindow(PWINDOW);
|
g_pHyprRenderer->damageWindow(PWINDOW);
|
||||||
@ -215,13 +216,17 @@ void CAnimationManager::tick() {
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
w->updateWindowDecos();
|
w->updateWindowDecos();
|
||||||
|
|
||||||
|
// damage any workspace window that is on any monitor
|
||||||
|
if (!w->m_bPinned)
|
||||||
|
g_pHyprRenderer->damageWindow(w.get());
|
||||||
}
|
}
|
||||||
} else if (PLAYER) {
|
} else if (PLAYER) {
|
||||||
if (PLAYER->layer == ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND || PLAYER->layer == ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM)
|
if (PLAYER->layer == ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND || PLAYER->layer == ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM)
|
||||||
g_pHyprOpenGL->markBlurDirtyForMonitor(PMONITOR);
|
g_pHyprOpenGL->markBlurDirtyForMonitor(PMONITOR);
|
||||||
|
|
||||||
// some fucking layers miss 1 pixel???
|
// some fucking layers miss 1 pixel???
|
||||||
CBox expandBox = WLRBOXPREV;
|
CBox expandBox = CBox{PLAYER->realPosition.value(), PLAYER->realSize.value()};
|
||||||
expandBox.expand(5);
|
expandBox.expand(5);
|
||||||
g_pHyprRenderer->damageBox(&expandBox);
|
g_pHyprRenderer->damageBox(&expandBox);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user