renderer: don't render window on other mons during anim in

fixes #5139
This commit is contained in:
Vaxry 2024-03-17 01:05:26 +00:00
parent 0387528c56
commit e68c07d809
5 changed files with 14 additions and 0 deletions

View file

@ -524,6 +524,7 @@ void CWindow::onMap() {
"CWindow"); "CWindow");
m_vReportedSize = m_vPendingReportedSize; m_vReportedSize = m_vPendingReportedSize;
m_bAnimatingIn = true;
for (const auto& ctrl : g_pHyprRenderer->m_vTearingControllers) { for (const auto& ctrl : g_pHyprRenderer->m_vTearingControllers) {
if (ctrl->pWlrHint->surface != m_pWLSurface.wlr()) if (ctrl->pWlrHint->surface != m_pWLSurface.wlr())

View file

@ -296,6 +296,7 @@ class CWindow {
Vector2D m_vOriginalClosedPos; // these will be used for calculations later on in Vector2D m_vOriginalClosedPos; // these will be used for calculations later on in
Vector2D m_vOriginalClosedSize; // drawing the closing animations Vector2D m_vOriginalClosedSize; // drawing the closing animations
SWindowDecorationExtents m_eOriginalClosedExtents; SWindowDecorationExtents m_eOriginalClosedExtents;
bool m_bAnimatingIn = false;
// For pinned (sticky) windows // For pinned (sticky) windows
bool m_bPinned = false; bool m_bPinned = false;

View file

@ -36,6 +36,9 @@ void setAnimToMove(void* data) {
CBaseAnimatedVariable* animvar = (CBaseAnimatedVariable*)data; CBaseAnimatedVariable* animvar = (CBaseAnimatedVariable*)data;
animvar->setConfig(PANIMCFG); animvar->setConfig(PANIMCFG);
if (animvar->getWindow() && !animvar->getWindow()->m_vRealPosition.isBeingAnimated() && !animvar->getWindow()->m_vRealSize.isBeingAnimated())
animvar->getWindow()->m_bAnimatingIn = false;
} }
void Events::listener_mapWindow(void* owner, void* data) { void Events::listener_mapWindow(void* owner, void* data) {

View file

@ -52,6 +52,7 @@ class CWorkspace;
struct SLayerSurface; struct SLayerSurface;
struct SAnimationPropertyConfig; struct SAnimationPropertyConfig;
class CHyprRenderer; class CHyprRenderer;
class CWindow;
// Utility to define a concept as a list of possible type // Utility to define a concept as a list of possible type
template <class T, class... U> template <class T, class... U>
@ -135,6 +136,10 @@ class CBaseAnimatedVariable {
m_bRemoveEndAfterRan = false; m_bRemoveEndAfterRan = false;
} }
CWindow* getWindow() {
return (CWindow*)m_pWindow;
}
protected: protected:
void* m_pWindow = nullptr; void* m_pWindow = nullptr;
void* m_pWorkspace = nullptr; void* m_pWorkspace = nullptr;

View file

@ -524,6 +524,10 @@ void CHyprRenderer::renderWindow(CWindow* pWindow, CMonitor* pMonitor, timespec*
g_pHyprOpenGL->m_RenderData.clipBox = rg.getExtents(); g_pHyprOpenGL->m_RenderData.clipBox = rg.getExtents();
} }
// if window is tiled and it's flying in, don't render on other mons (for slide)
if (!ignorePosition && !pWindow->m_bIsFloating && pWindow->m_vRealPosition.isBeingAnimated() && pWindow->m_bAnimatingIn && pWindow->m_iMonitorID != pMonitor->ID)
return;
// render window decorations first, if not fullscreen full // render window decorations first, if not fullscreen full
if (mode == RENDER_PASS_ALL || mode == RENDER_PASS_MAIN) { if (mode == RENDER_PASS_ALL || mode == RENDER_PASS_MAIN) {