diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2023-04-03 23:09:44 +0100 |
|---|---|---|
| committer | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2023-04-03 23:09:44 +0100 |
| commit | 55d585ce17b63126828071d685871159e8e74b0b (patch) | |
| tree | d6b4dd3f8542757270e50c6138ef94b70dd37996 /src/managers/input/InputManager.cpp | |
| parent | d3b0c90356d18c550739aaa26f05b3e4b9a1aa11 (diff) | |
input: fix click-to-refocus not working on loose
Diffstat (limited to 'src/managers/input/InputManager.cpp')
| -rw-r--r-- | src/managers/input/InputManager.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp index bf9286a8..ad1093cd 100644 --- a/src/managers/input/InputManager.cpp +++ b/src/managers/input/InputManager.cpp @@ -519,8 +519,17 @@ void CInputManager::processMouseDownNormal(wlr_pointer_button_event* e) { if (*PFOLLOWMOUSE == 3) // don't refocus on full loose break; - if (!g_pCompositor->m_sSeat.mouse || !g_pCompositor->m_sSeat.mouse->currentConstraint) - refocus(); + if (!g_pCompositor->m_sSeat.mouse || !g_pCompositor->m_sSeat.mouse->currentConstraint) { + // a bit hacky + // if we only pressed one button, allow us to refocus. m_lCurrentlyHeldButtons.size() > 0 will stick the focus + if (m_lCurrentlyHeldButtons.size() == 1) { + const auto COPY = m_lCurrentlyHeldButtons; + m_lCurrentlyHeldButtons.clear(); + refocus(); + m_lCurrentlyHeldButtons = COPY; + } else + refocus(); + } // if clicked on a floating window make it top if (g_pCompositor->m_pLastWindow && g_pCompositor->m_pLastWindow->m_bIsFloating) |
