diff --git a/src/events/Windows.cpp b/src/events/Windows.cpp index 45a0b561..99e9f623 100644 --- a/src/events/Windows.cpp +++ b/src/events/Windows.cpp @@ -29,18 +29,12 @@ void addViewCoords(void* pWindow, int* x, int* y) { } } -int setAnimToMove(void* data) { - const auto PWINDOW = (CWindow*)data; - +void setAnimToMove(void* data) { auto *const PANIMCFG = g_pConfigManager->getAnimationPropertyConfig("windowsMove"); - if (!g_pCompositor->windowValidMapped(PWINDOW)) - return 0; + CAnimatedVariable* animvar = (CAnimatedVariable*)data; - PWINDOW->m_vRealPosition.setConfig(PANIMCFG); - PWINDOW->m_vRealSize.setConfig(PANIMCFG); - - return 0; + animvar->setConfig(PANIMCFG); } void Events::listener_mapWindow(void* owner, void* data) { @@ -447,8 +441,8 @@ void Events::listener_mapWindow(void* owner, void* data) { PWINDOW->m_fAlpha.setValueAndWarp(0.f); PWINDOW->m_fAlpha = 255.f; - const auto TIMER = wl_event_loop_add_timer(g_pCompositor->m_sWLEventLoop, setAnimToMove, PWINDOW); - wl_event_source_timer_update(TIMER, PWINDOW->m_vRealPosition.getDurationLeftMs() + 5); + PWINDOW->m_vRealPosition.setCallbackOnEnd(setAnimToMove); + PWINDOW->m_vRealSize.setCallbackOnEnd(setAnimToMove); if (requestsFullscreen && !PWINDOW->m_bNoFullscreenRequest) { // fix fullscreen on requested (basically do a switcheroo) diff --git a/src/layout/IHyprLayout.cpp b/src/layout/IHyprLayout.cpp index d2304971..a5ff761e 100644 --- a/src/layout/IHyprLayout.cpp +++ b/src/layout/IHyprLayout.cpp @@ -139,9 +139,6 @@ void IHyprLayout::onBeginDragWindow() { g_pInputManager->setCursorImageUntilUnset("hand1"); - DRAGGINGWINDOW->m_vRealPosition.setConfig(g_pConfigManager->getAnimationPropertyConfig("windowsMove")); - DRAGGINGWINDOW->m_vRealSize.setConfig(g_pConfigManager->getAnimationPropertyConfig("windowsMove")); - DRAGGINGWINDOW->m_bDraggingTiled = false; if (!DRAGGINGWINDOW->m_bIsFloating) {