From bca3068db224d76b2da3f792efe4d0cb8cd2fe3e Mon Sep 17 00:00:00 2001 From: memchr <118117622+memchr@users.noreply.github.com> Date: Fri, 9 Jun 2023 21:44:18 +0000 Subject: feat: add lockactivegroup dispatcher (#2478) * feat: add lockactivegroup dispatcher The `lockactivewindow` dispatcher takes `lock`, `toggle` or `unlock` as arguments. When a group is locked, no window or group can be added to it, nor can it be added to another group, but the `moveintogroup` and `moveoutofgroup` dispatches are not affected. Implementation details: the lock is implement via `SGroupData.locked` flag (defaults to false). The flag is only relevant to the group head, and upon the group head's succession, the flag will be passed down to the new head. Meanwhile, the old head's flag will be set to false. The flag is set to false when a group is dismissed. New condition checks have been added to the dwindle and master layout to check if target group is unlocked (and if the source is also a group and unlocked) before adding windows to the target group. * refactor: `lockactivegroup dispatcher code ordering --- src/Window.hpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/Window.hpp') diff --git a/src/Window.hpp b/src/Window.hpp index c1a36d21..437b4a40 100644 --- a/src/Window.hpp +++ b/src/Window.hpp @@ -288,6 +288,7 @@ class CWindow { struct SGroupData { CWindow* pNextWindow = nullptr; // nullptr means no grouping. Self means single group. bool head = false; + bool locked = false; } m_sGroupData; // For the list lookup -- cgit v1.2.3