diff options
author | vaxerski <[email protected]> | 2022-11-18 13:53:54 +0000 |
---|---|---|
committer | vaxerski <[email protected]> | 2022-11-18 13:53:54 +0000 |
commit | f91f3d1c81f89dc3fcb468672fbd0f1030d7b7ac (patch) | |
tree | 1ddb3f256134485ac94062099e0342dab34e399e | |
parent | 5d39223239d86479ffd9639661c92006f8ba6489 (diff) | |
download | Hyprland-f91f3d1c81f89dc3fcb468672fbd0f1030d7b7ac.tar.gz Hyprland-f91f3d1c81f89dc3fcb468672fbd0f1030d7b7ac.zip |
Reset callbacks on remap
-rw-r--r-- | src/Window.cpp | 10 | ||||
-rw-r--r-- | src/helpers/AnimatedVariable.hpp | 8 |
2 files changed, 18 insertions, 0 deletions
diff --git a/src/Window.cpp b/src/Window.cpp index 31cbb3ce..66035f42 100644 --- a/src/Window.cpp +++ b/src/Window.cpp @@ -265,6 +265,16 @@ void CWindow::onUnmap() { } void CWindow::onMap() { + + // JIC, reset the callbacks. If any are set, we'll make sure they are cleared so we don't accidentally unset them. (In case a window got remapped) + m_vRealPosition.resetAllCallbacks(); + m_vRealSize.resetAllCallbacks(); + m_cRealBorderColor.resetAllCallbacks(); + m_fActiveInactiveAlpha.resetAllCallbacks(); + m_fAlpha.resetAllCallbacks(); + m_cRealShadowColor.resetAllCallbacks(); + m_fDimPercent.resetAllCallbacks(); + m_vRealPosition.registerVar(); m_vRealSize.registerVar(); m_cRealBorderColor.registerVar(); diff --git a/src/helpers/AnimatedVariable.hpp b/src/helpers/AnimatedVariable.hpp index 2c2c3ccf..ab1dcf42 100644 --- a/src/helpers/AnimatedVariable.hpp +++ b/src/helpers/AnimatedVariable.hpp @@ -205,6 +205,14 @@ public: m_bRemoveBeginAfterRan = remove; } + /* resets all callbacks. Does not call any. */ + void resetAllCallbacks() { + m_fBeginCallback = nullptr; + m_fEndCallback = nullptr; + m_bRemoveBeginAfterRan = false; + m_bRemoveEndAfterRan = false; + } + private: Vector2D m_vValue = Vector2D(0,0); |