diff options
author | David Rosca <nowrep@gmail.com> | 2021-12-14 08:15:45 +0100 |
---|---|---|
committer | David Rosca <nowrep@gmail.com> | 2021-12-14 08:23:53 +0100 |
commit | 31914928d22934a09d2f19ef996500c324bd5ff2 (patch) | |
tree | d7ae4b1e09dd67f1184d4dbe28ad6a8b461175e6 | |
parent | 1c3e0816f3cc4c653b24256486234d02fcf59e02 (diff) | |
download | wlroots-31914928d22934a09d2f19ef996500c324bd5ff2.tar.xz |
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.
-rw-r--r-- | types/seat/wlr_seat_keyboard.c | 2 | ||||
-rw-r--r-- | types/seat/wlr_seat_pointer.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/types/seat/wlr_seat_keyboard.c b/types/seat/wlr_seat_keyboard.c index e97b4825..57dbfe2f 100644 --- a/types/seat/wlr_seat_keyboard.c +++ b/types/seat/wlr_seat_keyboard.c @@ -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; diff --git a/types/seat/wlr_seat_pointer.c b/types/seat/wlr_seat_pointer.c index 27ece5e8..2fa911ee 100644 --- a/types/seat/wlr_seat_pointer.c +++ b/types/seat/wlr_seat_pointer.c @@ -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; |