diff options
| author | memchr <118117622+memchr@users.noreply.github.com> | 2023-09-13 10:13:29 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-09-13 11:13:29 +0100 |
| commit | 6b1ac659e005042a6970ffc489aef71e0875af15 (patch) | |
| tree | ce0e73429f76dcd884d27cafdadfda51b925b57f /src/layout/IHyprLayout.hpp | |
| parent | b0d5e4008b96f2cdbb6f6c2449c790d921d1546b (diff) | |
layout: add direction parameter to onWindowCreated and friends (#3269)
* feat(layout): add direction parameter to onWindowCreated and friends
In addition:
- Implement directional moveWindowOutOfGroup for `movewindoworgroup`
when using dwindle layout. (augmentation of #3006)
- Replace `DWindleLayout::OneTimeFocus` with `IHyprLayout::eDirection`.
- Slight formatting change (clang-format).
* fix: nullptr dereference in dwindle window creation
* refactor: generalized eDirection
* refactor: eliminate DIRECTION_NONE
* Update IHyprLayout.hpp
Diffstat (limited to 'src/layout/IHyprLayout.hpp')
| -rw-r--r-- | src/layout/IHyprLayout.hpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/layout/IHyprLayout.hpp b/src/layout/IHyprLayout.hpp index 282eb1ea..15acbc1d 100644 --- a/src/layout/IHyprLayout.hpp +++ b/src/layout/IHyprLayout.hpp @@ -15,8 +15,7 @@ struct SLayoutMessageHeader { enum eFullscreenMode : uint8_t; -enum eRectCorner -{ +enum eRectCorner { CORNER_NONE = 0, CORNER_TOPLEFT, CORNER_TOPRIGHT, @@ -24,6 +23,14 @@ enum eRectCorner CORNER_BOTTOMLEFT }; +enum eDirection { + DIRECTION_DEFAULT = -1, + DIRECTION_UP = 0, + DIRECTION_RIGHT, + DIRECTION_DOWN, + DIRECTION_LEFT +}; + class IHyprLayout { public: virtual ~IHyprLayout() = 0; @@ -35,8 +42,8 @@ class IHyprLayout { The layout HAS TO set the goal pos and size (anim mgr will use it) If !animationinprogress, then the anim mgr will not apply an anim. */ - virtual void onWindowCreated(CWindow*); - virtual void onWindowCreatedTiling(CWindow*) = 0; + virtual void onWindowCreated(CWindow*, eDirection direction = DIRECTION_DEFAULT); + virtual void onWindowCreatedTiling(CWindow*, eDirection direction = DIRECTION_DEFAULT) = 0; virtual void onWindowCreatedFloating(CWindow*); /* |
