summaryrefslogtreecommitdiff
path: root/src/managers/KeybindManager.cpp
diff options
context:
space:
mode:
authormemchr <118117622+memchr@users.noreply.github.com>2023-10-11 10:13:12 +0000
committerGitHub <noreply@github.com>2023-10-11 11:13:12 +0100
commit34455844e9ac623e68375bb007535cdf979f2a02 (patch)
tree21ed296be3c8ba9bd21235cb3c579889388edc8b /src/managers/KeybindManager.cpp
parentd83357f4976a240a4418a1a0a16641518a47da25 (diff)
groups: ensure consistency in dispatcher behavior with global group lock (#3531)
Diffstat (limited to 'src/managers/KeybindManager.cpp')
-rw-r--r--src/managers/KeybindManager.cpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp
index 52581b62..fd298d34 100644
--- a/src/managers/KeybindManager.cpp
+++ b/src/managers/KeybindManager.cpp
@@ -2019,7 +2019,10 @@ void CKeybindManager::moveWindowOutOfGroup(CWindow* pWindow, const std::string&
void CKeybindManager::moveIntoGroup(std::string args) {
char arg = args[0];
- static auto* const BIGNOREGROUPLOCK = &g_pConfigManager->getConfigValuePtr("binds:ignore_group_lock")->intValue;
+ static auto* const PIGNOREGROUPLOCK = &g_pConfigManager->getConfigValuePtr("binds:ignore_group_lock")->intValue;
+
+ if (!*PIGNOREGROUPLOCK && g_pKeybindManager->m_bGroupsLocked)
+ return;
if (!isDirection(args)) {
Debug::log(ERR, "Cannot move into group in direction {}, unsupported direction. Supported: l,r,u/t,d/b", arg);
@@ -2037,13 +2040,18 @@ void CKeybindManager::moveIntoGroup(std::string args) {
return;
// Do not move window into locked group if binds:ignore_group_lock is false
- if (!*BIGNOREGROUPLOCK && (PWINDOWINDIR->getGroupHead()->m_sGroupData.locked || (PWINDOW->m_sGroupData.pNextWindow && PWINDOW->getGroupHead()->m_sGroupData.locked)))
+ if (!*PIGNOREGROUPLOCK && (PWINDOWINDIR->getGroupHead()->m_sGroupData.locked || (PWINDOW->m_sGroupData.pNextWindow && PWINDOW->getGroupHead()->m_sGroupData.locked)))
return;
moveWindowIntoGroup(PWINDOW, PWINDOWINDIR);
}
void CKeybindManager::moveOutOfGroup(std::string args) {
+ static auto* const PIGNOREGROUPLOCK = &g_pConfigManager->getConfigValuePtr("binds:ignore_group_lock")->intValue;
+
+ if (!*PIGNOREGROUPLOCK && g_pKeybindManager->m_bGroupsLocked)
+ return;
+
const auto PWINDOW = g_pCompositor->m_pLastWindow;
if (!PWINDOW || !PWINDOW->m_sGroupData.pNextWindow)
@@ -2065,6 +2073,12 @@ void CKeybindManager::moveWindowOrGroup(std::string args) {
const auto PWINDOW = g_pCompositor->m_pLastWindow;
if (!PWINDOW || PWINDOW->m_bIsFullscreen)
return;
+
+ if (!*PIGNOREGROUPLOCK && g_pKeybindManager->m_bGroupsLocked) {
+ g_pLayoutManager->getCurrentLayout()->moveWindowTo(PWINDOW, args);
+ return;
+ }
+
const auto PWINDOWINDIR = g_pCompositor->getWindowInDirection(PWINDOW, arg);
const bool ISWINDOWGROUP = PWINDOW->m_sGroupData.pNextWindow;