diff options
author | vaxerski <[email protected]> | 2022-11-08 20:28:41 +0000 |
---|---|---|
committer | vaxerski <[email protected]> | 2022-11-08 20:28:41 +0000 |
commit | 1cf829c889ea50476ac0b45d9031e6c1a7da0f55 (patch) | |
tree | da62fc80e36b64965208369fc40cb8b34657ac35 | |
parent | 17992b633ddacae06dea9743e1464cb990ee596f (diff) | |
download | Hyprland-1cf829c889ea50476ac0b45d9031e6c1a7da0f55.tar.gz Hyprland-1cf829c889ea50476ac0b45d9031e6c1a7da0f55.zip |
minor loose focus fixes
-rw-r--r-- | src/layout/IHyprLayout.cpp | 3 | ||||
-rw-r--r-- | src/managers/input/InputManager.cpp | 6 |
2 files changed, 8 insertions, 1 deletions
diff --git a/src/layout/IHyprLayout.cpp b/src/layout/IHyprLayout.cpp index 2636c1aa..fa697bea 100644 --- a/src/layout/IHyprLayout.cpp +++ b/src/layout/IHyprLayout.cpp @@ -183,10 +183,13 @@ void IHyprLayout::onEndDragWindow() { if (DRAGGINGWINDOW->m_bDraggingTiled) { DRAGGINGWINDOW->m_bIsFloating = false; + g_pInputManager->refocus(); changeWindowFloatingMode(DRAGGINGWINDOW); } g_pHyprRenderer->damageWindow(DRAGGINGWINDOW); + + g_pCompositor->focusWindow(DRAGGINGWINDOW); } void IHyprLayout::onMouseMove(const Vector2D& mousePos) { diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp index 6d475375..adca5b14 100644 --- a/src/managers/input/InputManager.cpp +++ b/src/managers/input/InputManager.cpp @@ -294,7 +294,7 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) { m_bLastFocusOnLS = false; return; // don't enter any new surfaces } else { - if ((*PFOLLOWMOUSE != 3 && allowKeyboardRefocus) || (refocus && *PFOLLOWMOUSE != 3)) + if ((*PFOLLOWMOUSE != 3 && allowKeyboardRefocus) || refocus) g_pCompositor->focusWindow(pFoundWindow, foundSurface); } @@ -387,12 +387,16 @@ void CInputManager::processMouseDownNormal(wlr_pointer_button_event* e) { // notify the keybind manager static auto *const PPASSMOUSE = &g_pConfigManager->getConfigValuePtr("binds:pass_mouse_when_bound")->intValue; const auto PASS = g_pKeybindManager->onMouseEvent(e); + static auto *const PFOLLOWMOUSE = &g_pConfigManager->getConfigValuePtr("input:follow_mouse")->intValue; if (!PASS && !*PPASSMOUSE) return; switch (e->state) { case WLR_BUTTON_PRESSED: + if (*PFOLLOWMOUSE == 3) // don't refocus on full loose + break; + if (!g_pCompositor->m_sSeat.mouse->currentConstraint) refocus(); |