types/wlr_pointer_gestures_v1: null-check both focused_surface and focused_client

(fixes #3385)
This commit is contained in:
Ferdinand Bachmann 2022-03-27 23:21:32 +02:00
parent 4ba8458255
commit eedb9df531

View file

@ -52,7 +52,9 @@ void wlr_pointer_gestures_v1_send_swipe_begin(
uint32_t time_msec,
uint32_t fingers) {
struct wlr_surface *focus = seat->pointer_state.focused_surface;
if (focus == NULL) {
struct wlr_seat_client *focus_seat_client =
seat->pointer_state.focused_client;
if (focus == NULL || focus_seat_client == NULL) {
return;
}
@ -79,7 +81,9 @@ void wlr_pointer_gestures_v1_send_swipe_update(
double dx,
double dy) {
struct wlr_surface *focus = seat->pointer_state.focused_surface;
if (focus == NULL) {
struct wlr_seat_client *focus_seat_client =
seat->pointer_state.focused_client;
if (focus == NULL || focus_seat_client == NULL) {
return;
}
@ -103,7 +107,9 @@ void wlr_pointer_gestures_v1_send_swipe_end(
uint32_t time_msec,
bool cancelled) {
struct wlr_surface *focus = seat->pointer_state.focused_surface;
if (focus == NULL) {
struct wlr_seat_client *focus_seat_client =
seat->pointer_state.focused_client;
if (focus == NULL || focus_seat_client == NULL) {
return;
}
@ -164,7 +170,9 @@ void wlr_pointer_gestures_v1_send_pinch_begin(
uint32_t time_msec,
uint32_t fingers) {
struct wlr_surface *focus = seat->pointer_state.focused_surface;
if (focus == NULL) {
struct wlr_seat_client *focus_seat_client =
seat->pointer_state.focused_client;
if (focus == NULL || focus_seat_client == NULL) {
return;
}
@ -193,7 +201,9 @@ void wlr_pointer_gestures_v1_send_pinch_update(
double scale,
double rotation) {
struct wlr_surface *focus = seat->pointer_state.focused_surface;
if (focus == NULL) {
struct wlr_seat_client *focus_seat_client =
seat->pointer_state.focused_client;
if (focus == NULL || focus_seat_client == NULL) {
return;
}
@ -219,7 +229,9 @@ void wlr_pointer_gestures_v1_send_pinch_end(
uint32_t time_msec,
bool cancelled) {
struct wlr_surface *focus = seat->pointer_state.focused_surface;
if (focus == NULL) {
struct wlr_seat_client *focus_seat_client =
seat->pointer_state.focused_client;
if (focus == NULL || focus_seat_client == NULL) {
return;
}
@ -285,7 +297,9 @@ void wlr_pointer_gestures_v1_send_hold_begin(
uint32_t time_msec,
uint32_t fingers) {
struct wlr_surface *focus = seat->pointer_state.focused_surface;
if (focus == NULL) {
struct wlr_seat_client *focus_seat_client =
seat->pointer_state.focused_client;
if (focus == NULL || focus_seat_client == NULL) {
return;
}
@ -311,7 +325,9 @@ void wlr_pointer_gestures_v1_send_hold_end(
uint32_t time_msec,
bool cancelled) {
struct wlr_surface *focus = seat->pointer_state.focused_surface;
if (focus == NULL) {
struct wlr_seat_client *focus_seat_client =
seat->pointer_state.focused_client;
if (focus == NULL || focus_seat_client == NULL) {
return;
}