fix crash: only forward button events when seat has pointer focus
wlr_seat_pointer_notify_button asserts unconditionally if no surface has pointer focus, even for releases. Never call it without a focused surface. This means clients may miss releases if pointer leaves their surface during a drag, but avoids the compositor crash.
This commit is contained in:
parent
8c306b3e3c
commit
10389bbba5
|
|
@ -327,11 +327,11 @@ handle_pointer_button(struct wl_listener *listener, void *data)
|
|||
}
|
||||
}
|
||||
|
||||
if (forward_to_client) {
|
||||
if (forward_to_client && wl_state.seat->pointer_state.focused_surface) {
|
||||
wlr_seat_pointer_notify_button(wl_state.seat, ev->time_msec,
|
||||
ev->button, ev->state);
|
||||
wlr_seat_pointer_notify_frame(wl_state.seat);
|
||||
}
|
||||
wlr_seat_pointer_notify_frame(wl_state.seat);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
Loading…
Reference in New Issue