diff options
author | vaxerski <[email protected]> | 2022-12-09 14:03:37 +0000 |
---|---|---|
committer | vaxerski <[email protected]> | 2022-12-09 14:03:37 +0000 |
commit | ff12a41c40b8529330c06f37120787cf40bde980 (patch) | |
tree | d06ae55807086788aa540b8f46bc645e57f7b950 | |
parent | 629cca481626c4a271230244df4a41f19e4fc253 (diff) | |
download | Hyprland-ff12a41c40b8529330c06f37120787cf40bde980.tar.gz Hyprland-ff12a41c40b8529330c06f37120787cf40bde980.zip |
minor focus fixes with LS-es and moving windows
-rw-r--r-- | src/managers/KeybindManager.cpp | 4 | ||||
-rw-r--r-- | src/managers/input/InputManager.cpp | 10 |
2 files changed, 11 insertions, 3 deletions
diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp index 9176ffcd..3dd6488b 100644 --- a/src/managers/KeybindManager.cpp +++ b/src/managers/KeybindManager.cpp @@ -1015,6 +1015,10 @@ void CKeybindManager::moveActiveToWorkspaceSilent(std::string args) { // manually post event cuz it got ignored above g_pEventManager->postEvent(SHyprIPCEvent{"movewindow", getFormat("%x,%s", PWINDOW, PWORKSPACE->m_szName.c_str())}); + // this window is gone. Unfocus if needed + if (g_pCompositor->m_pLastWindow == PWINDOW) + g_pCompositor->focusWindow(nullptr); + g_pInputManager->refocus(); } diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp index 55935800..e8e22343 100644 --- a/src/managers/input/InputManager.cpp +++ b/src/managers/input/InputManager.cpp @@ -297,12 +297,16 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) { m_bLastFocusOnLS = false; } else { + if (pFoundLayerSurface) { + m_bLastFocusOnLS = true; + if (pFoundLayerSurface->layer <= ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM) { + g_pCompositor->focusWindow(nullptr); + } + } + if (pFoundLayerSurface && pFoundLayerSurface->layerSurface->current.keyboard_interactive && *PFOLLOWMOUSE != 3 && allowKeyboardRefocus) { g_pCompositor->focusSurface(foundSurface); } - - if (pFoundLayerSurface) - m_bLastFocusOnLS = true; } wlr_seat_pointer_notify_enter(g_pCompositor->m_sSeat.seat, foundSurface, surfaceLocal.x, surfaceLocal.y); |