mirror of
https://github.com/hyprwm/Hyprland
synced 2025-02-17 01:02:51 +01:00
input: fix click-to-refocus not working on loose
This commit is contained in:
parent
d3b0c90356
commit
55d585ce17
1 changed files with 11 additions and 2 deletions
|
@ -519,8 +519,17 @@ void CInputManager::processMouseDownNormal(wlr_pointer_button_event* e) {
|
||||||
if (*PFOLLOWMOUSE == 3) // don't refocus on full loose
|
if (*PFOLLOWMOUSE == 3) // don't refocus on full loose
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (!g_pCompositor->m_sSeat.mouse || !g_pCompositor->m_sSeat.mouse->currentConstraint)
|
if (!g_pCompositor->m_sSeat.mouse || !g_pCompositor->m_sSeat.mouse->currentConstraint) {
|
||||||
refocus();
|
// 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 clicked on a floating window make it top
|
||||||
if (g_pCompositor->m_pLastWindow && g_pCompositor->m_pLastWindow->m_bIsFloating)
|
if (g_pCompositor->m_pLastWindow && g_pCompositor->m_pLastWindow->m_bIsFloating)
|
||||||
|
|
Loading…
Add table
Reference in a new issue