summaryrefslogtreecommitdiff
path: root/src/managers/KeybindManager.cpp
diff options
context:
space:
mode:
authorFederico Maria Morrone <contact@morrone.dev>2024-02-17 23:44:22 +0100
committerGitHub <noreply@github.com>2024-02-17 22:44:22 +0000
commit5261a8df81c1aad07b582bce82d164801de533b0 (patch)
treec68b44cc830d33f57a27831523fab33fde5d04fa /src/managers/KeybindManager.cpp
parent289d952a6ee02f6d54a0899870bbec52ff9a53df (diff)
keybinds: Add an option to pass a window argument to moveoutofgroup (#4724)
* keybinds: allow passing window to moveoutofgroup * keybinds: cleaner handling of certain args
Diffstat (limited to 'src/managers/KeybindManager.cpp')
-rw-r--r--src/managers/KeybindManager.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp
index 9c56d557..1b68f862 100644
--- a/src/managers/KeybindManager.cpp
+++ b/src/managers/KeybindManager.cpp
@@ -797,7 +797,7 @@ void CKeybindManager::clearKeybinds() {
void CKeybindManager::toggleActiveFloating(std::string args) {
CWindow* PWINDOW = nullptr;
- if (args != "" && args != "active" && args.length() > 1)
+ if (args != "active" && args.length() > 1)
PWINDOW = g_pCompositor->getWindowByRegex(args);
else
PWINDOW = g_pCompositor->m_pLastWindow;
@@ -1941,7 +1941,7 @@ void CKeybindManager::pinActive(std::string args) {
CWindow* PWINDOW = nullptr;
- if (args != "" && args != "active" && args.length() > 1)
+ if (args != "active" && args.length() > 1)
PWINDOW = g_pCompositor->getWindowByRegex(args);
else
PWINDOW = g_pCompositor->m_pLastWindow;
@@ -2180,7 +2180,12 @@ void CKeybindManager::moveOutOfGroup(std::string args) {
if (!*PIGNOREGROUPLOCK && g_pKeybindManager->m_bGroupsLocked)
return;
- const auto PWINDOW = g_pCompositor->m_pLastWindow;
+ CWindow* PWINDOW = nullptr;
+
+ if (args != "active" && args.length() > 1)
+ PWINDOW = g_pCompositor->getWindowByRegex(args);
+ else
+ PWINDOW = g_pCompositor->m_pLastWindow;
if (!PWINDOW || !PWINDOW->m_sGroupData.pNextWindow)
return;