diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-03-20 11:14:24 +0100 |
|---|---|---|
| committer | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-03-20 11:14:24 +0100 |
| commit | a4b026df2b7f94b2985d38b1ef6fb127782c1a27 (patch) | |
| tree | c85f054baed6951fa096a358096fecc4e5c08a19 /src/managers/KeybindManager.cpp | |
| parent | a4d69a15b34e54d8438a7242b151b1d31cbef46a (diff) | |
floating windows support
Diffstat (limited to 'src/managers/KeybindManager.cpp')
| -rw-r--r-- | src/managers/KeybindManager.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp index a4206340..96bf65fa 100644 --- a/src/managers/KeybindManager.cpp +++ b/src/managers/KeybindManager.cpp @@ -42,6 +42,7 @@ bool CKeybindManager::handleKeybinds(const uint32_t& modmask, const xkb_keysym_t // yes. if (k.handler == "exec") { spawn(k.arg); } else if (k.handler == "killactive") { killActive(k.arg); } + else if (k.handler == "togglefloating") { toggleActiveFloating(k.arg); } found = true; } @@ -64,8 +65,19 @@ void CKeybindManager::spawn(std::string args) { void CKeybindManager::killActive(std::string args) { if (g_pCompositor->m_pLastFocus && g_pCompositor->windowValidMapped(g_pCompositor->m_pLastFocus)) g_pXWaylandManager->sendCloseWindow(g_pCompositor->m_pLastFocus); + + g_pCompositor->focusWindow(g_pCompositor->windowFromCursor()); } void CKeybindManager::clearKeybinds() { m_dKeybinds.clear(); +} + +void CKeybindManager::toggleActiveFloating(std::string args) { + const auto ACTIVEWINDOW = g_pCompositor->m_pLastFocus; + + if (g_pCompositor->windowValidMapped(ACTIVEWINDOW)) { + ACTIVEWINDOW->m_bIsFloating = !ACTIVEWINDOW->m_bIsFloating; + g_pLayoutManager->getCurrentLayout()->changeWindowFloatingMode(ACTIVEWINDOW); + } }
\ No newline at end of file |
