From 6b1ac659e005042a6970ffc489aef71e0875af15 Mon Sep 17 00:00:00 2001 From: memchr <118117622+memchr@users.noreply.github.com> Date: Wed, 13 Sep 2023 10:13:29 +0000 Subject: 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 --- src/layout/DwindleLayout.hpp | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'src/layout/DwindleLayout.hpp') diff --git a/src/layout/DwindleLayout.hpp b/src/layout/DwindleLayout.hpp index a901e4da..66c117fc 100644 --- a/src/layout/DwindleLayout.hpp +++ b/src/layout/DwindleLayout.hpp @@ -10,15 +10,6 @@ class CHyprDwindleLayout; enum eFullscreenMode : uint8_t; -enum OneTimeFocus -{ - UP = 0, - RIGHT, - DOWN, - LEFT, - NOFOCUS, -}; - struct SDwindleNodeData { SDwindleNodeData* pParent = nullptr; bool isNode = false; @@ -51,7 +42,7 @@ struct SDwindleNodeData { class CHyprDwindleLayout : public IHyprLayout { public: - virtual void onWindowCreatedTiling(CWindow*); + virtual void onWindowCreatedTiling(CWindow*, eDirection direction = DIRECTION_DEFAULT); virtual void onWindowRemovedTiling(CWindow*); virtual bool isWindowTiled(CWindow*); virtual void recalculateMonitor(const int&); @@ -90,7 +81,7 @@ class CHyprDwindleLayout : public IHyprLayout { void toggleSplit(CWindow*); - OneTimeFocus overrideDirection = OneTimeFocus::NOFOCUS; + eDirection overrideDirection = DIRECTION_DEFAULT; friend struct SDwindleNodeData; }; -- cgit v1.2.3