aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorvaxerski <[email protected]>2022-09-04 18:42:11 +0200
committervaxerski <[email protected]>2022-09-04 18:42:11 +0200
commitba0c5fe0bba9ac671f4238b968e4728671eef3f8 (patch)
tree828802c3b10fd7dde2bdf3e73d39455986ac6bb5
parentf6ecef0959163d10dd6597037192456977aa5bc2 (diff)
downloadHyprland-ba0c5fe0bba9ac671f4238b968e4728671eef3f8.tar.gz
Hyprland-ba0c5fe0bba9ac671f4238b968e4728671eef3f8.zip
fix mouse focus not returning from a LS on follow mouse 0
-rw-r--r--src/managers/input/InputManager.cpp14
-rw-r--r--src/managers/input/InputManager.hpp3
2 files changed, 14 insertions, 3 deletions
diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp
index e4173a6d..af950b5b 100644
--- a/src/managers/input/InputManager.cpp
+++ b/src/managers/input/InputManager.cpp
@@ -269,9 +269,11 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) {
wlr_seat_pointer_notify_enter(g_pCompositor->m_sSeat.seat, foundSurface, surfaceLocal.x, surfaceLocal.y);
}
- if (pFoundWindow == g_pCompositor->m_pLastWindow && foundSurface != g_pCompositor->m_pLastFocus) {
- // we changed the subsurface
- wlr_seat_pointer_notify_enter(g_pCompositor->m_sSeat.seat, foundSurface, surfaceLocal.x, surfaceLocal.y);
+ if (pFoundWindow == g_pCompositor->m_pLastWindow) {
+ if (foundSurface != g_pCompositor->m_pLastFocus || m_bLastFocusOnLS) {
+ // ^^^ changed the subsurface ^^^ came back from a LS
+ wlr_seat_pointer_notify_enter(g_pCompositor->m_sSeat.seat, foundSurface, surfaceLocal.x, surfaceLocal.y);
+ }
}
if (*PFOLLOWONDND && m_sDrag.dragIcon) {
@@ -279,16 +281,22 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) {
}
wlr_seat_pointer_notify_motion(g_pCompositor->m_sSeat.seat, time, surfaceLocal.x, surfaceLocal.y);
+ m_bLastFocusOnLS = false;
return; // don't enter any new surfaces
} else {
if ((*PFOLLOWMOUSE != 3 && allowKeyboardRefocus) || refocus)
g_pCompositor->focusWindow(pFoundWindow, foundSurface);
}
+
+ m_bLastFocusOnLS = false;
} else {
if (pFoundLayerSurface && pFoundLayerSurface->layerSurface->current.keyboard_interactive && *PFOLLOWMOUSE != 3 && allowKeyboardRefocus) {
g_pCompositor->focusSurface(foundSurface);
g_pCompositor->m_pLastWindow = nullptr; // reset last window as we have a full focus on a LS
}
+
+ if (pFoundLayerSurface)
+ m_bLastFocusOnLS = true;
}
wlr_seat_pointer_notify_enter(g_pCompositor->m_sSeat.seat, foundSurface, surfaceLocal.x, surfaceLocal.y);
diff --git a/src/managers/input/InputManager.hpp b/src/managers/input/InputManager.hpp
index aed91584..82d047f3 100644
--- a/src/managers/input/InputManager.hpp
+++ b/src/managers/input/InputManager.hpp
@@ -105,6 +105,9 @@ private:
bool m_bEmptyFocusCursorSet = false;
Vector2D m_vLastCursorPosFloored = Vector2D();
+ // for some bugs in follow mouse 0
+ bool m_bLastFocusOnLS = false;
+
void processMouseDownNormal(wlr_pointer_button_event* e);
void processMouseDownKill(wlr_pointer_button_event* e);