Commit graph

23 commits

Author SHA1 Message Date
Vaxry
1ed1ce9506
internal: new shared_ptr and weak_ptr implementation (#5883)
moves std::shared_ptrs to a new implementation

Advantages:
- you can dereference a weak_ptr directly. This will obviously segfault on a nullptr deref if it's expired.
   - this is useful to avoid the .lock() hell where we are 100% sure the pointer _should_ be valid. (and if it isn't, it should throw.)
- weak_ptrs are still valid while the SP is being destroyed.
   - reasoning: while an object (e.g. CWindow) is being destroyed, its `weak_ptr self` should be accessible (the sp is still alive, and so is CWindow), but it's not because by stl it's already expired (to prevent resurrection)
   - this impl solves it differently. w_p is expired, but can still be dereferenced and used. Creating `s_p`s is not possible anymore, though.
   - this is useful in destructors and callbacks.
2024-05-05 17:16:00 +01:00
Vaxry
bca7804bb6
internal: Window storage rework - part 1 (#5762)
* Window storage rework - part 1

* format

* remove useless include

* fix pch

* format

* fix crash in dwindle

* fix vram leak

* prefer .expired() for bool checks
2024-04-27 12:43:12 +01:00
Vaxry
f2a848cbcc
core: Event loop rework (#5466)
* Event loop rework

* revert missed
2024-04-07 03:31:51 +01:00
8593c45be3 refactor: move window.hpp to desktop/ 2024-03-20 01:44:51 +00:00
GartoxFR
b2c3440477
animations: Refactor AnimatedVariable (#4911)
* animation: Refactor AnimatedVariable

This commit decomposes the AnimatedVariable class into a base class
with the common attribute to all variable types and a templated derived
type containing strongly typed info on the type being animated.

Access to the typed version is perfomed using the visitor pattern. A
utility is provided to build a visitor on the fly using lambdas.

Adding a new type to be animated should just be a matter of adding the
typed in the list defined by the ANIMABLE_TYPES macro

The size of the commit is justified by the API change in the
AnimatedVariable class. No more vec(), fl() or col() method but a unified
value() method.

* animation: Remove visitor pattern

* animation: Fix coding style

* animation: Fix coding style
2024-03-02 00:35:17 +00:00
Vaxry
d9292800a2
internal: Unsafe state reworks (#3114) 2023-09-01 22:03:56 +02:00
a077b7a92e animationmgr: avoid redundant ticks 2023-08-05 23:29:33 +02:00
vaxerski
6c1f4faff2 animationmgr: avoid looping over all avars in favor of only active ones 2023-07-20 19:26:10 +02:00
vaxerski
66b8629964 Update the debug overlay 2023-03-03 12:15:59 +00:00
vaxerski
34685a836a Move AnimationManager::tick() to an event loop 2023-03-02 17:30:50 +00:00
vaxerski
9813ba2f56 Add hyprctl animations 2023-01-25 15:16:28 +00:00
5d095bb9e1 use curves for special dim anim 2022-12-29 12:30:43 +01:00
Vaxry
98a4fa2b0d
Added clang format (#1239)
* clang-format stuff and format files
2022-12-16 17:17:31 +00:00
3a8dcf284a add more errors 2022-08-07 19:28:46 +02:00
64e80991ca added popin anim minimum % 2022-08-06 22:11:08 +02:00
vaxerski
15553804d6 Added closing animations (reverse of open) 2022-05-28 18:28:55 +02:00
vaxerski
d7ad80e6a2 Added window animation rules 2022-05-15 14:18:31 +02:00
vaxerski
694f4433a2 Added animation style and style slide 2022-05-14 16:43:30 +02:00
vaxerski
3ebe7d7972 Added bezier curves 2022-04-23 21:47:16 +02:00
vaxerski
0147975faf New animation system 2022-04-23 14:16:02 +02:00
vaxerski
75af34da96 added basic damage tracking 2022-04-14 16:43:29 +02:00
vaxerski
586e2a98ed Added animated borders 2022-03-31 17:50:00 +02:00
vaxerski
bcf7ee6dc2 Added basic animations for windows 2022-03-23 22:01:59 +01:00