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
This commit is contained in:
memchr
2023-09-13 10:13:29 +00:00
committed by GitHub
parent b0d5e4008b
commit 6b1ac659e0
8 changed files with 69 additions and 59 deletions

View File

@@ -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;
};