diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-07-07 21:47:59 +0200 |
|---|---|---|
| committer | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-07-07 21:47:59 +0200 |
| commit | 75c2a378e3c9368feb57a31710de26decc3da3bc (patch) | |
| tree | 7148f4ba7d80869a0dd88a57989e573522a8e45d /src/managers | |
| parent | 96f19d706ae317b89744e6709781903c7b943371 (diff) | |
unfocus keyboard on refocus null
Diffstat (limited to 'src/managers')
| -rw-r--r-- | src/managers/XWaylandManager.cpp | 4 | ||||
| -rw-r--r-- | src/managers/input/InputManager.cpp | 9 |
2 files changed, 11 insertions, 2 deletions
diff --git a/src/managers/XWaylandManager.cpp b/src/managers/XWaylandManager.cpp index 6bb512ee..855cbc2c 100644 --- a/src/managers/XWaylandManager.cpp +++ b/src/managers/XWaylandManager.cpp @@ -36,7 +36,9 @@ void CHyprXWaylandManager::activateSurface(wlr_surface* pSurface, bool activate) wlr_xdg_toplevel_set_activated(wlr_xdg_surface_from_wlr_surface(pSurface)->toplevel, activate); else if (wlr_surface_is_xwayland_surface(pSurface)) { wlr_xwayland_surface_activate(wlr_xwayland_surface_from_wlr_surface(pSurface), activate); - wlr_xwayland_surface_restack(wlr_xwayland_surface_from_wlr_surface(pSurface), NULL, XCB_STACK_MODE_ABOVE); + + if (activate) + wlr_xwayland_surface_restack(wlr_xwayland_surface_from_wlr_surface(pSurface), NULL, XCB_STACK_MODE_ABOVE); } } diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp index b95a507c..d5febe66 100644 --- a/src/managers/input/InputManager.cpp +++ b/src/managers/input/InputManager.cpp @@ -28,6 +28,8 @@ void CInputManager::onMouseWarp(wlr_pointer_motion_absolute_event* e) { void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) { + static auto *const PFOLLOWMOUSE = &g_pConfigManager->getConfigValuePtr("input:follow_mouse")->intValue; + if (!g_pCompositor->m_bReadyToProcess) return; @@ -194,6 +196,12 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) { wlr_seat_pointer_clear_focus(g_pCompositor->m_sSeat.seat); + if (refocus) { // if we are forcing a refocus, and we don't find a surface, clear the kb focus too! + g_pCompositor->focusSurface(nullptr); + + g_pCompositor->m_pLastWindow = nullptr; + } + return; } @@ -211,7 +219,6 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) { } if (pFoundWindow) { - static auto *const PFOLLOWMOUSE = &g_pConfigManager->getConfigValuePtr("input:follow_mouse")->intValue; if (*PFOLLOWMOUSE != 1 && !refocus) { if (pFoundWindow != g_pCompositor->m_pLastWindow && g_pCompositor->windowValidMapped(g_pCompositor->m_pLastWindow) && (g_pCompositor->m_pLastWindow->m_bIsFloating != pFoundWindow->m_bIsFloating)) { // enter if change floating style |
