mirror of
https://github.com/hyprwm/Hyprland
synced 2024-12-23 01:29:50 +01:00
animations: Fix incorrect animation when manually moving a window when its being created (#5141)
* fix incorrect rendering when manually moving a window when its being created * add setAnimationsToMove
This commit is contained in:
parent
7a31c954e5
commit
e6532ba024
5 changed files with 22 additions and 0 deletions
|
@ -389,6 +389,8 @@ void CWindow::moveToWorkspace(int workspaceID) {
|
|||
|
||||
const auto PWORKSPACE = g_pCompositor->getWorkspaceByID(m_iWorkspaceID);
|
||||
|
||||
setAnimationsToMove();
|
||||
|
||||
updateSpecialRenderData();
|
||||
|
||||
if (PWORKSPACE) {
|
||||
|
@ -1147,3 +1149,10 @@ bool CWindow::visibleOnMonitor(CMonitor* pMonitor) {
|
|||
|
||||
return wlr_output_layout_intersects(g_pCompositor->m_sWLROutputLayout, pMonitor->output, wbox.pWlr());
|
||||
}
|
||||
|
||||
void CWindow::setAnimationsToMove() {
|
||||
auto* const PANIMCFG = g_pConfigManager->getAnimationPropertyConfig("windowsMove");
|
||||
m_vRealPosition.setConfig(PANIMCFG);
|
||||
m_vRealSize.setConfig(PANIMCFG);
|
||||
m_bAnimatingIn = false;
|
||||
}
|
||||
|
|
|
@ -419,6 +419,7 @@ class CWindow {
|
|||
void insertWindowToGroup(CWindow* pWindow);
|
||||
void updateGroupOutputs();
|
||||
void switchWithWindowInGroup(CWindow* pWindow);
|
||||
void setAnimationsToMove();
|
||||
|
||||
private:
|
||||
// For hidden windows and stuff
|
||||
|
|
|
@ -924,6 +924,8 @@ void CHyprDwindleLayout::moveWindowTo(CWindow* pWindow, const std::string& dir)
|
|||
default: UNREACHABLE();
|
||||
}
|
||||
|
||||
pWindow->setAnimationsToMove();
|
||||
|
||||
onWindowRemovedTiling(pWindow);
|
||||
|
||||
m_vOverrideFocalPoint = focalPoint;
|
||||
|
@ -969,6 +971,9 @@ void CHyprDwindleLayout::switchWindows(CWindow* pWindow, CWindow* pWindow2) {
|
|||
std::swap(pWindow2->m_iWorkspaceID, pWindow->m_iWorkspaceID);
|
||||
}
|
||||
|
||||
pWindow->setAnimationsToMove();
|
||||
pWindow2->setAnimationsToMove();
|
||||
|
||||
// recalc the workspace
|
||||
getMasterNodeOnWorkspace(PNODE->workspaceID)->recalcSizePosRecursive();
|
||||
|
||||
|
|
|
@ -552,6 +552,8 @@ void IHyprLayout::moveActiveWindow(const Vector2D& delta, CWindow* pWindow) {
|
|||
return;
|
||||
}
|
||||
|
||||
PWINDOW->setAnimationsToMove();
|
||||
|
||||
PWINDOW->m_vRealPosition = PWINDOW->m_vRealPosition.goal() + delta;
|
||||
|
||||
g_pHyprRenderer->damageWindow(PWINDOW);
|
||||
|
|
|
@ -970,6 +970,8 @@ void CHyprMasterLayout::moveWindowTo(CWindow* pWindow, const std::string& dir) {
|
|||
|
||||
const auto PWINDOW2 = g_pCompositor->getWindowInDirection(pWindow, dir[0]);
|
||||
|
||||
pWindow->setAnimationsToMove();
|
||||
|
||||
if (pWindow->m_iWorkspaceID != PWINDOW2->m_iWorkspaceID) {
|
||||
// if different monitors, send to monitor
|
||||
onWindowRemovedTiling(pWindow);
|
||||
|
@ -1002,6 +1004,9 @@ void CHyprMasterLayout::switchWindows(CWindow* pWindow, CWindow* pWindow2) {
|
|||
PNODE->pWindow = pWindow2;
|
||||
PNODE2->pWindow = pWindow;
|
||||
|
||||
pWindow->setAnimationsToMove();
|
||||
pWindow2->setAnimationsToMove();
|
||||
|
||||
recalculateMonitor(pWindow->m_iMonitorID);
|
||||
if (PNODE2->workspaceID != PNODE->workspaceID)
|
||||
recalculateMonitor(pWindow2->m_iMonitorID);
|
||||
|
|
Loading…
Reference in a new issue