aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFerdinand Bachmann <theferdi265@gmail.com>2022-03-27 23:21:32 +0200
committerFerdinand Bachmann <theferdi265@gmail.com>2022-04-15 16:06:16 +0200
commiteedb9df531ae73061c0f72ef2944df6f0068f6cd (patch)
treed7429df3c56bd36b8e72fc1622b70a056b9c84c0
parent4ba84582550ed582afeea16369be9401da8122d7 (diff)
types/wlr_pointer_gestures_v1: null-check both focused_surface and focused_client
(fixes #3385)
-rw-r--r--types/wlr_pointer_gestures_v1.c32
1 files changed, 24 insertions, 8 deletions
diff --git a/types/wlr_pointer_gestures_v1.c b/types/wlr_pointer_gestures_v1.c
index b8229dfc..1601b792 100644
--- a/types/wlr_pointer_gestures_v1.c
+++ b/types/wlr_pointer_gestures_v1.c
@@ -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;
}