summaryrefslogtreecommitdiff
path: root/src/protocols/core/Seat.cpp
diff options
context:
space:
mode:
authorVaxry <vaxry@vaxry.net>2024-06-16 17:04:10 +0200
committerVaxry <vaxry@vaxry.net>2024-06-16 17:04:10 +0200
commitd0a6fa7aa6c3a9d94611130a9213de19a8754d67 (patch)
tree8e1d4cfc725ac402bffefd545d02ecb315cc9e67 /src/protocols/core/Seat.cpp
parent648ac8a00b0d68a9e3a86e928b30a490870dbed6 (diff)
wl_seat: accomodate for apps late-binding seat resources
Sends enter events when an app binds wl_keyboard or wl_pointer later than it should. Fixes some buggy apps. Fixes #6131
Diffstat (limited to 'src/protocols/core/Seat.cpp')
-rw-r--r--src/protocols/core/Seat.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/protocols/core/Seat.cpp b/src/protocols/core/Seat.cpp
index 8f9174f5..be05955c 100644
--- a/src/protocols/core/Seat.cpp
+++ b/src/protocols/core/Seat.cpp
@@ -98,6 +98,9 @@ CWLPointerResource::CWLPointerResource(SP<CWlPointer> resource_, SP<CWLSeatResou
g_pSeatManager->onSetCursor(owner.lock(), serial, surf ? CWLSurfaceResource::fromResource(surf) : nullptr, {hotX, hotY});
});
+
+ if (g_pSeatManager->state.pointerFocus && g_pSeatManager->state.pointerFocus->client() == resource->client())
+ sendEnter(g_pSeatManager->state.pointerFocus.lock(), {-1, -1} /* Coords don't really matter that much, they will be updated next move */);
}
bool CWLPointerResource::good() {
@@ -207,6 +210,9 @@ CWLKeyboardResource::CWLKeyboardResource(SP<CWlKeyboard> resource_, SP<CWLSeatRe
sendKeymap(g_pSeatManager->keyboard.lock());
repeatInfo(g_pSeatManager->keyboard->repeatRate, g_pSeatManager->keyboard->repeatDelay);
+
+ if (g_pSeatManager->state.keyboardFocus && g_pSeatManager->state.keyboardFocus->client() == resource->client())
+ sendEnter(g_pSeatManager->state.keyboardFocus.lock());
}
bool CWLKeyboardResource::good() {