mirror of
https://github.com/hyprwm/Hyprland
synced 2026-05-07 11:38:01 +02:00
input: keep pointer focus on layer surfaces during keyboard refocus
Do not let sendMotionEventsToFocused() steal pointer focus from non-window surfaces such as waybar when follow_mouse is disabled. This keeps keyboard focus changes from workspace switches from moving pointer focus off the bar under the cursor, which otherwise makes workspace scrolling on waybar behave one event behind.
This commit is contained in:
parent
019dac7a05
commit
dd75dc5dad
1 changed files with 10 additions and 0 deletions
|
|
@ -175,6 +175,16 @@ void CInputManager::sendMotionEventsToFocused() {
|
|||
if (!Desktop::focusState()->surface() || isConstrained())
|
||||
return;
|
||||
|
||||
const auto POINTERSURF = g_pSeatManager->m_state.pointerFocus.lock();
|
||||
if (POINTERSURF) {
|
||||
const auto POINTERHLSURF = Desktop::View::CWLSurface::fromResource(POINTERSURF);
|
||||
|
||||
// Keep pointer focus on desktop components such as bars or popups that are
|
||||
// currently under the cursor. Keyboard focus changes should not steal it.
|
||||
if (POINTERHLSURF && (!POINTERHLSURF->view() || POINTERHLSURF->view()->type() != Desktop::View::VIEW_TYPE_WINDOW))
|
||||
return;
|
||||
}
|
||||
|
||||
const auto SURF = Desktop::focusState()->surface();
|
||||
|
||||
if (!SURF)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue