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.
master
David Rosca 3 years ago
parent 1c3e0816f3
commit 31914928d2
No known key found for this signature in database
GPG Key ID: EBC3FC294452C6D8

@ -415,7 +415,7 @@ void seat_client_create_keyboard(struct wlr_seat_client *seat_client,
seat_client->seat->keyboard_state.focused_surface; seat_client->seat->keyboard_state.focused_surface;
// Send an enter event if there is a focused client/surface stored // 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; uint32_t *keycodes = keyboard->keycodes;
size_t num_keycodes = keyboard->num_keycodes; size_t num_keycodes = keyboard->num_keycodes;

@ -446,7 +446,7 @@ void seat_client_create_pointer(struct wlr_seat_client *seat_client,
seat_client->seat->pointer_state.focused_surface; seat_client->seat->pointer_state.focused_surface;
// Send an enter event if there is a focused client/surface stored // 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 sx = seat_client->seat->pointer_state.sx;
double sy = seat_client->seat->pointer_state.sy; double sy = seat_client->seat->pointer_state.sy;

Loading…
Cancel
Save