mirror of
https://github.com/hyprwm/Hyprland
synced 2024-12-22 18:29:50 +01:00
use anim callbacks and don't spam config resets in drag
This commit is contained in:
parent
fba03540d5
commit
b9812f8bc0
2 changed files with 5 additions and 14 deletions
|
@ -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)
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue