diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-09-12 21:05:52 +0200 |
|---|---|---|
| committer | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-09-12 21:05:52 +0200 |
| commit | 006228109281ed4d07ace635cf419c605d62e4a6 (patch) | |
| tree | 41f723bf0addc7d35ee341c151169a32a4f043ec /src/managers/KeybindManager.cpp | |
| parent | 81f267dff95f16a6442688dbeaf25fb01b818a04 (diff) | |
added wsbind
Diffstat (limited to 'src/managers/KeybindManager.cpp')
| -rw-r--r-- | src/managers/KeybindManager.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp index 821b0588..6b6f8f3c 100644 --- a/src/managers/KeybindManager.cpp +++ b/src/managers/KeybindManager.cpp @@ -679,7 +679,9 @@ void CKeybindManager::changeworkspace(std::string args) { } // Workspace doesn't exist, create and switch - const auto PMONITOR = g_pCompositor->getMonitorFromCursor(); + const auto BOUNDMON = g_pConfigManager->getBoundMonitorForWS(workspaceName); + + const auto PMONITOR = BOUNDMON ? BOUNDMON : g_pCompositor->getMonitorFromCursor(); const auto OLDWORKSPACE = PMONITOR->activeWorkspace; @@ -727,6 +729,12 @@ void CKeybindManager::changeworkspace(std::string args) { // mark the monitor dirty g_pHyprRenderer->damageMonitor(PMONITOR); + // some stuf with the cursor and focus + if (g_pCompositor->m_pLastMonitor != PMONITOR) + g_pCompositor->warpCursorTo(PMONITOR->vecPosition + PMONITOR->vecSize / 2.f); + + g_pCompositor->m_pLastMonitor = PMONITOR; + // focus (clears the last) g_pInputManager->refocus(); @@ -872,7 +880,12 @@ void CKeybindManager::moveActiveToWorkspaceSilent(std::string args) { // may be null until later! auto PWORKSPACE = g_pCompositor->getWorkspaceByID(workspaceToMoveTo); - const auto PMONITORNEW = PWORKSPACE ? g_pCompositor->getMonitorFromID(PWORKSPACE->m_iMonitorID) : PMONITOR; + auto PMONITORNEW = PWORKSPACE ? g_pCompositor->getMonitorFromID(PWORKSPACE->m_iMonitorID) : PMONITOR; + if (!PWORKSPACE) { + const auto BOUNDMON = g_pConfigManager->getBoundMonitorForWS(workspaceName); + if (BOUNDMON) + PMONITORNEW = BOUNDMON; + } const auto OLDWORKSPACEIDONMONITOR = PMONITORNEW->activeWorkspace; const auto OLDWORKSPACEIDRETURN = PMONITOR->activeWorkspace; |
