aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxdavidwu <xdavidwuph@gmail.com>2023-07-18 13:09:24 +0000
committerDaniel Eklöf <daniel@ekloef.se>2023-07-18 14:09:31 +0000
commit0b8791d1c5d1bc71daff481874e6c9e44d0dba79 (patch)
treed69fc58000d9b71d150b5187cf28085ccf420e38
parentMerge branch 'scale-is-floating-point' (diff)
wayland: fix pointer cap lost handling
Before this, on compositor without cursor-shape support, a pointer capability lost of the seat makes foot crash.
-rw-r--r--wayland.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/wayland.c b/wayland.c
index 354a0e78..7e51bfe9 100644
--- a/wayland.c
+++ b/wayland.c
@@ -341,8 +341,10 @@ seat_handle_capabilities(void *data, struct wl_seat *wl_seat,
} else {
if (seat->wl_pointer != NULL) {
#if defined(HAVE_CURSOR_SHAPE)
- wp_cursor_shape_device_v1_destroy(seat->pointer.shape_device);
- seat->pointer.shape_device = NULL;
+ if (seat->pointer.shape_device != NULL) {
+ wp_cursor_shape_device_v1_destroy(seat->pointer.shape_device);
+ seat->pointer.shape_device = NULL;
+ }
#endif
wl_pointer_release(seat->wl_pointer);