summaryrefslogtreecommitdiff
path: root/src/managers/KeybindManager.cpp
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2023-05-01 15:39:08 +0100
committervaxerski <43317083+vaxerski@users.noreply.github.com>2023-05-01 15:39:08 +0100
commit45b1e6dc5ee42b01a377bd875181bc621c72f914 (patch)
treec5bf4a0b7cb0a2cdded2f1ded531a17dac7c96dd /src/managers/KeybindManager.cpp
parentd6b069458d990d372eaa9a35bb8726605b44a588 (diff)
keybinds: simulate workspace switch on focusWindow to another ws
Diffstat (limited to 'src/managers/KeybindManager.cpp')
-rw-r--r--src/managers/KeybindManager.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp
index 49722142..27de2b4e 100644
--- a/src/managers/KeybindManager.cpp
+++ b/src/managers/KeybindManager.cpp
@@ -1145,7 +1145,7 @@ void CKeybindManager::moveActiveTo(std::string args) {
const auto PWORKSPACE = g_pCompositor->getWorkspaceByID(PMONITORTOCHANGETO->activeWorkspace);
- moveActiveToWorkspace(PMONITORTOCHANGETO->activeWorkspace < 0 ? "name:" + PWORKSPACE->m_szName : std::to_string(PMONITORTOCHANGETO->activeWorkspace));
+ moveActiveToWorkspace(PWORKSPACE->getConfigName());
}
void CKeybindManager::toggleGroup(std::string args) {
@@ -1659,6 +1659,16 @@ void CKeybindManager::focusWindow(std::string regexp) {
Debug::log(LOG, "Focusing to window name: %s", PWINDOW->m_szTitle.c_str());
+ if (g_pCompositor->m_pLastMonitor->activeWorkspace != PWINDOW->m_iWorkspaceID) {
+ Debug::log(LOG, "Fake executing workspace to move focus");
+ const auto PWORKSPACE = g_pCompositor->getWorkspaceByID(PWINDOW->m_iWorkspaceID);
+ if (!PWORKSPACE) {
+ Debug::log(ERR, "BUG THIS: null workspace in focusWindow");
+ return;
+ }
+ changeworkspace(PWORKSPACE->getConfigName());
+ }
+
if (PWINDOW->isHidden() && PWINDOW->m_sGroupData.pNextWindow) {
// grouped, change the current to us
PWINDOW->setGroupCurrent(PWINDOW);