diff options
| author | memchr <118117622+memchr@users.noreply.github.com> | 2023-09-21 23:42:00 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-09-22 00:42:00 +0100 |
| commit | 1357b66091ecd73f097d19d527a23a9ae72a4ff1 (patch) | |
| tree | e629bedcce584757ebd1afae0dcc12ea25f15c95 /src/Window.hpp | |
| parent | 2e1842b5ff140bc81a604c663482221d86c30cff (diff) | |
windowrules: add rule `group` to map windows grouped (#3279)
* windows: add rule group to map windows grouped
* group rule: use `invade` to force open a window in a locked group
Diffstat (limited to 'src/Window.hpp')
| -rw-r--r-- | src/Window.hpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/Window.hpp b/src/Window.hpp index 7e4c73b8..81b6156f 100644 --- a/src/Window.hpp +++ b/src/Window.hpp @@ -18,6 +18,18 @@ enum eIdleInhibitMode { IDLEINHIBIT_FOCUS }; +enum eGroupRules { + // effective only during first map, except for _ALWAYS variant + GROUP_NONE = 0, + GROUP_SET = 1 << 0, // Open as new group or add to focused group + GROUP_SET_ALWAYS = 1 << 1, + GROUP_BARRED = 1 << 2, // Don't insert to focused group. + GROUP_LOCK = 1 << 3, // Lock m_sGroupData.lock + GROUP_LOCK_ALWAYS = 1 << 4, + GROUP_INVADE = 1 << 5, // Force enter a group, event if lock is engaged + GROUP_OVERRIDE = 1 << 6, // Override other rules +}; + template <typename T> class CWindowOverridableVar { public: @@ -300,8 +312,10 @@ class CWindow { struct SGroupData { CWindow* pNextWindow = nullptr; // nullptr means no grouping. Self means single group. bool head = false; - bool locked = false; + bool locked = false; // per group lock + bool deny = false; // deny window from enter a group or made a group } m_sGroupData; + uint16_t m_eGroupRules = GROUP_NONE; // For the list lookup bool operator==(const CWindow& rhs) { @@ -342,6 +356,9 @@ class CWindow { bool isInCurvedCorner(double x, double y); bool hasPopupAt(const Vector2D& pos); + void applyGroupRules(); + void createGroup(); + void destroyGroup(); CWindow* getGroupHead(); CWindow* getGroupTail(); CWindow* getGroupCurrent(); |
