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