summaryrefslogtreecommitdiff
path: root/src/managers/KeybindManager.cpp
diff options
context:
space:
mode:
authorAlexander <51529891+Truenya@users.noreply.github.com>2025-01-21 17:17:07 +0300
committerGitHub <noreply@github.com>2025-01-21 14:17:07 +0000
commitda6e9663135aa492252fe8684747ff734730a323 (patch)
treeda146b42fe7ef819aaa2eef83e300f27a6667fa4 /src/managers/KeybindManager.cpp
parenta661203bb6d4714b211572759e2f74b1da194972 (diff)
keybinds: add visible arg for cyclenext (#9045)
Co-authored-by: Крылов Александр <aleksandr.krylov@hyperus.team>
Diffstat (limited to 'src/managers/KeybindManager.cpp')
-rw-r--r--src/managers/KeybindManager.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp
index 65891840..0816de2a 100644
--- a/src/managers/KeybindManager.cpp
+++ b/src/managers/KeybindManager.cpp
@@ -750,7 +750,7 @@ SDispatchResult CKeybindManager::handleKeybinds(const uint32_t modmask, const SP
Debug::log(ERR, "Invalid handler in a keybind! (handler {} does not exist)", k->handler);
} else {
// call the dispatcher
- Debug::log(LOG, "Keybind triggered, calling dispatcher ({}, {}, {})", modmask, key.keyName, key.keysym);
+ Debug::log(LOG, "Keybind triggered, calling dispatcher ({}, {}, {}, {})", modmask, key.keyName, key.keysym, DISPATCHER->first);
m_iPassPressed = (int)pressed;
@@ -2201,7 +2201,6 @@ SDispatchResult CKeybindManager::resizeWindow(std::string args) {
}
SDispatchResult CKeybindManager::circleNext(std::string arg) {
-
if (g_pCompositor->m_pLastWindow.expired()) {
// if we have a clear focus, find the first window and get the next focusable.
const auto PWS = g_pCompositor->m_pLastMonitor->activeWorkspace;
@@ -2221,10 +2220,12 @@ SDispatchResult CKeybindManager::circleNext(std::string arg) {
else if (args.contains("float") || args.contains("floating"))
floatStatus = true;
- if (args.contains("prev") || args.contains("p") || args.contains("last") || args.contains("l"))
- switchToWindow(g_pCompositor->getPrevWindowOnWorkspace(g_pCompositor->m_pLastWindow.lock(), true, floatStatus));
- else
- switchToWindow(g_pCompositor->getNextWindowOnWorkspace(g_pCompositor->m_pLastWindow.lock(), true, floatStatus));
+ const auto VISIBLE = args.contains("visible") || args.contains("v");
+ const auto& w = (args.contains("prev") || args.contains("p") || args.contains("last") || args.contains("l")) ?
+ g_pCompositor->getPrevWindowOnWorkspace(g_pCompositor->m_pLastWindow.lock(), true, floatStatus, VISIBLE) :
+ g_pCompositor->getNextWindowOnWorkspace(g_pCompositor->m_pLastWindow.lock(), true, floatStatus, VISIBLE);
+
+ switchToWindow(w);
return {};
}