mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-07 07:31:53 -07:00
fix various shadow damage issues
This commit is contained in:
@@ -178,8 +178,6 @@ void IHyprLayout::onMouseMove(const Vector2D& mousePos) {
|
|||||||
if (g_pInputManager->dragButton == BTN_LEFT) {
|
if (g_pInputManager->dragButton == BTN_LEFT) {
|
||||||
DRAGGINGWINDOW->m_vRealPosition.setValueAndWarp(m_vBeginDragPositionXY + DELTA);
|
DRAGGINGWINDOW->m_vRealPosition.setValueAndWarp(m_vBeginDragPositionXY + DELTA);
|
||||||
|
|
||||||
DRAGGINGWINDOW->updateWindowDecos();
|
|
||||||
|
|
||||||
g_pXWaylandManager->setWindowSize(DRAGGINGWINDOW, DRAGGINGWINDOW->m_vRealSize.goalv());
|
g_pXWaylandManager->setWindowSize(DRAGGINGWINDOW, DRAGGINGWINDOW->m_vRealSize.goalv());
|
||||||
} else {
|
} else {
|
||||||
if (DRAGGINGWINDOW->m_bIsFloating) {
|
if (DRAGGINGWINDOW->m_bIsFloating) {
|
||||||
@@ -189,8 +187,6 @@ void IHyprLayout::onMouseMove(const Vector2D& mousePos) {
|
|||||||
DRAGGINGWINDOW->m_vRealSize.setValueAndWarp(m_vBeginDragSizeXY + DELTA);
|
DRAGGINGWINDOW->m_vRealSize.setValueAndWarp(m_vBeginDragSizeXY + DELTA);
|
||||||
DRAGGINGWINDOW->m_vRealSize.setValueAndWarp(Vector2D(std::clamp(DRAGGINGWINDOW->m_vRealSize.vec().x, (double)20, (double)MAXSIZE.x), std::clamp(DRAGGINGWINDOW->m_vRealSize.vec().y, (double)20, (double)MAXSIZE.y)));
|
DRAGGINGWINDOW->m_vRealSize.setValueAndWarp(Vector2D(std::clamp(DRAGGINGWINDOW->m_vRealSize.vec().x, (double)20, (double)MAXSIZE.x), std::clamp(DRAGGINGWINDOW->m_vRealSize.vec().y, (double)20, (double)MAXSIZE.y)));
|
||||||
|
|
||||||
DRAGGINGWINDOW->updateWindowDecos();
|
|
||||||
|
|
||||||
g_pXWaylandManager->setWindowSize(DRAGGINGWINDOW, DRAGGINGWINDOW->m_vRealSize.goalv());
|
g_pXWaylandManager->setWindowSize(DRAGGINGWINDOW, DRAGGINGWINDOW->m_vRealSize.goalv());
|
||||||
} else {
|
} else {
|
||||||
resizeActiveWindow(TICKDELTA, DRAGGINGWINDOW);
|
resizeActiveWindow(TICKDELTA, DRAGGINGWINDOW);
|
||||||
@@ -208,6 +204,8 @@ void IHyprLayout::onMouseMove(const Vector2D& mousePos) {
|
|||||||
DRAGGINGWINDOW->m_iWorkspaceID = PMONITOR->activeWorkspace;
|
DRAGGINGWINDOW->m_iWorkspaceID = PMONITOR->activeWorkspace;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DRAGGINGWINDOW->updateWindowDecos();
|
||||||
|
|
||||||
g_pHyprRenderer->damageWindow(DRAGGINGWINDOW);
|
g_pHyprRenderer->damageWindow(DRAGGINGWINDOW);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -147,8 +147,8 @@ void CAnimationManager::tick() {
|
|||||||
g_pHyprRenderer->damageBox(&WLRBOXPREV);
|
g_pHyprRenderer->damageBox(&WLRBOXPREV);
|
||||||
|
|
||||||
if (PWINDOW) {
|
if (PWINDOW) {
|
||||||
g_pHyprRenderer->damageWindow(PWINDOW);
|
|
||||||
PWINDOW->updateWindowDecos();
|
PWINDOW->updateWindowDecos();
|
||||||
|
g_pHyprRenderer->damageWindow(PWINDOW);
|
||||||
} else if (PWORKSPACE) {
|
} else if (PWORKSPACE) {
|
||||||
for (auto& w : g_pCompositor->m_vWindows) {
|
for (auto& w : g_pCompositor->m_vWindows) {
|
||||||
if (!w->m_bIsMapped || w->m_bHidden)
|
if (!w->m_bIsMapped || w->m_bHidden)
|
||||||
@@ -197,7 +197,7 @@ void CAnimationManager::tick() {
|
|||||||
if (PDECO) {
|
if (PDECO) {
|
||||||
const auto EXTENTS = PDECO->getWindowDecorationExtents();
|
const auto EXTENTS = PDECO->getWindowDecorationExtents();
|
||||||
|
|
||||||
wlr_box dmg = {PWINDOW->m_vRealPosition.vec().x + EXTENTS.topLeft.x, PWINDOW->m_vRealPosition.vec().y + EXTENTS.topLeft.y,
|
wlr_box dmg = {PWINDOW->m_vRealPosition.vec().x - EXTENTS.topLeft.x, PWINDOW->m_vRealPosition.vec().y - EXTENTS.topLeft.y,
|
||||||
PWINDOW->m_vRealSize.vec().x + EXTENTS.topLeft.x + EXTENTS.bottomRight.x, PWINDOW->m_vRealSize.vec().y + EXTENTS.topLeft.y + EXTENTS.bottomRight.y};
|
PWINDOW->m_vRealSize.vec().x + EXTENTS.topLeft.x + EXTENTS.bottomRight.x, PWINDOW->m_vRealSize.vec().y + EXTENTS.topLeft.y + EXTENTS.bottomRight.y};
|
||||||
|
|
||||||
if (!*PSHADOWIGNOREWINDOW) {
|
if (!*PSHADOWIGNOREWINDOW) {
|
||||||
|
@@ -92,12 +92,14 @@ void CHyprDropShadowDecoration::draw(CMonitor* pMonitor, float a) {
|
|||||||
if (fullBox.width < 1 || fullBox.height < 1)
|
if (fullBox.width < 1 || fullBox.height < 1)
|
||||||
return; // don't draw invisible shadows
|
return; // don't draw invisible shadows
|
||||||
|
|
||||||
|
g_pHyprOpenGL->scissor((wlr_box *)nullptr);
|
||||||
|
|
||||||
if (*PSHADOWIGNOREWINDOW) {
|
if (*PSHADOWIGNOREWINDOW) {
|
||||||
|
glEnable(GL_STENCIL_TEST);
|
||||||
|
|
||||||
glClearStencil(0);
|
glClearStencil(0);
|
||||||
glClear(GL_STENCIL_BUFFER_BIT);
|
glClear(GL_STENCIL_BUFFER_BIT);
|
||||||
|
|
||||||
glEnable(GL_STENCIL_TEST);
|
|
||||||
|
|
||||||
glStencilFunc(GL_ALWAYS, 1, -1);
|
glStencilFunc(GL_ALWAYS, 1, -1);
|
||||||
glStencilOp(GL_KEEP, GL_KEEP, GL_REPLACE);
|
glStencilOp(GL_KEEP, GL_KEEP, GL_REPLACE);
|
||||||
|
|
||||||
@@ -106,6 +108,8 @@ void CHyprDropShadowDecoration::draw(CMonitor* pMonitor, float a) {
|
|||||||
scaleBox(&windowBox, pMonitor->scale);
|
scaleBox(&windowBox, pMonitor->scale);
|
||||||
|
|
||||||
if (windowBox.width < 1 || windowBox.height < 1) {
|
if (windowBox.width < 1 || windowBox.height < 1) {
|
||||||
|
glClearStencil(0);
|
||||||
|
glClear(GL_STENCIL_BUFFER_BIT);
|
||||||
glDisable(GL_STENCIL_TEST);
|
glDisable(GL_STENCIL_TEST);
|
||||||
return; // prevent assert failed
|
return; // prevent assert failed
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user