seat: Only resend keyboard/pointer enter to focused clients

Otherwise it will send enter events to clients that already
have keyboard/pointer focus.
Notably Qt applications warns about this.
This commit is contained in:
David Rosca 2021-12-14 08:15:45 +01:00
parent 1c3e0816f3
commit 31914928d2
No known key found for this signature in database
GPG key ID: EBC3FC294452C6D8
2 changed files with 2 additions and 2 deletions

View file

@ -415,7 +415,7 @@ void seat_client_create_keyboard(struct wlr_seat_client *seat_client,
seat_client->seat->keyboard_state.focused_surface;
// Send an enter event if there is a focused client/surface stored
if (focused_client != NULL && focused_surface != NULL) {
if (focused_client == seat_client && focused_surface != NULL) {
uint32_t *keycodes = keyboard->keycodes;
size_t num_keycodes = keyboard->num_keycodes;

View file

@ -446,7 +446,7 @@ void seat_client_create_pointer(struct wlr_seat_client *seat_client,
seat_client->seat->pointer_state.focused_surface;
// Send an enter event if there is a focused client/surface stored
if (focused_client != NULL && focused_surface != NULL) {
if (focused_client == seat_client && focused_surface != NULL) {
double sx = seat_client->seat->pointer_state.sx;
double sy = seat_client->seat->pointer_state.sy;