From 1357b66091ecd73f097d19d527a23a9ae72a4ff1 Mon Sep 17 00:00:00 2001 From: memchr <118117622+memchr@users.noreply.github.com> Date: Thu, 21 Sep 2023 23:42:00 +0000 Subject: 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 --- src/Window.hpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'src/Window.hpp') 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 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(); -- cgit v1.2.3