diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-04-02 18:57:09 +0200 |
|---|---|---|
| committer | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-04-02 18:57:09 +0200 |
| commit | 223beb8a826773e2e3ea4c6d7e7d40fde9247d9a (patch) | |
| tree | 41d89a962caaf8e63f777e50cf00a2505e7f9a3e /src/managers/KeybindManager.cpp | |
| parent | c923b4f0756c3494d408a257c08922621d120ae2 (diff) | |
Multiple focus handling changes
Diffstat (limited to 'src/managers/KeybindManager.cpp')
| -rw-r--r-- | src/managers/KeybindManager.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp index 22c880b4..d9d2fa72 100644 --- a/src/managers/KeybindManager.cpp +++ b/src/managers/KeybindManager.cpp @@ -88,9 +88,12 @@ void CKeybindManager::spawn(std::string args) { } void CKeybindManager::killActive(std::string args) { - if (g_pCompositor->m_pLastFocus && g_pCompositor->windowValidMapped(g_pCompositor->getWindowFromSurface(g_pCompositor->m_pLastFocus))) - g_pXWaylandManager->sendCloseWindow(g_pCompositor->getWindowFromSurface(g_pCompositor->m_pLastFocus)); - + if (g_pCompositor->m_pLastWindow && g_pCompositor->windowValidMapped(g_pCompositor->m_pLastWindow)) { + g_pXWaylandManager->sendCloseWindow(g_pCompositor->m_pLastWindow); + g_pCompositor->m_pLastFocus = nullptr; + g_pCompositor->m_pLastWindow = nullptr; + } + g_pCompositor->focusWindow(g_pCompositor->windowFromCursor()); } @@ -99,7 +102,7 @@ void CKeybindManager::clearKeybinds() { } void CKeybindManager::toggleActiveFloating(std::string args) { - const auto ACTIVEWINDOW = g_pCompositor->getWindowFromSurface(g_pCompositor->m_pLastFocus); + const auto ACTIVEWINDOW = g_pCompositor->m_pLastWindow; if (g_pCompositor->windowValidMapped(ACTIVEWINDOW)) { ACTIVEWINDOW->m_bIsFloating = !ACTIVEWINDOW->m_bIsFloating; @@ -170,7 +173,7 @@ void CKeybindManager::changeworkspace(std::string args) { } void CKeybindManager::fullscreenActive(std::string args) { - const auto PWINDOW = g_pCompositor->getWindowFromSurface(g_pCompositor->m_pLastFocus); + const auto PWINDOW = g_pCompositor->m_pLastWindow; if (!g_pCompositor->windowValidMapped(PWINDOW)) return; @@ -187,7 +190,7 @@ void CKeybindManager::fullscreenActive(std::string args) { } void CKeybindManager::moveActiveToWorkspace(std::string args) { - const auto PWINDOW = g_pCompositor->getWindowFromSurface(g_pCompositor->m_pLastFocus); + const auto PWINDOW = g_pCompositor->m_pLastWindow; if (!g_pCompositor->windowValidMapped(PWINDOW)) return; |
