aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--types/seat/wlr_seat_pointer.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/types/seat/wlr_seat_pointer.c b/types/seat/wlr_seat_pointer.c
index d03385cf..e473d9b3 100644
--- a/types/seat/wlr_seat_pointer.c
+++ b/types/seat/wlr_seat_pointer.c
@@ -346,7 +346,11 @@ uint32_t wlr_seat_pointer_notify_button(struct wlr_seat *wlr_seat,
}
wlr_seat->pointer_state.button_count++;
} else {
- wlr_seat->pointer_state.button_count--;
+ if (wlr_seat->pointer_state.button_count == 0) {
+ wlr_log(WLR_ERROR, "Corrupted seat button count");
+ } else {
+ wlr_seat->pointer_state.button_count--;
+ }
}
struct wlr_seat_pointer_grab *grab = wlr_seat->pointer_state.grab;