diff options
author | emersion <contact@emersion.fr> | 2019-03-05 01:36:23 +0100 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2019-03-04 21:27:14 -0700 |
commit | 30d3426164b56e7340c33ae65baa66530b8e31a8 (patch) | |
tree | ea4b4a179d55685319fd296f5feecbe22c95a4fb | |
parent | 9601019192a411aca889db48e6dc6c856d1e2a64 (diff) |
seat: add debug logs when validating grab serials
Makes it easier to debug when something goes wrong, e.g. button_count stuck
to 2 because the compositor ate a button release event.
-rw-r--r-- | types/seat/wlr_seat_pointer.c | 6 | ||||
-rw-r--r-- | types/seat/wlr_seat_touch.c | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/types/seat/wlr_seat_pointer.c b/types/seat/wlr_seat_pointer.c index e65ad7c2..e1182fd2 100644 --- a/types/seat/wlr_seat_pointer.c +++ b/types/seat/wlr_seat_pointer.c @@ -412,10 +412,16 @@ bool wlr_seat_validate_pointer_grab_serial(struct wlr_seat *seat, struct wlr_surface *origin, uint32_t serial) { if (seat->pointer_state.button_count != 1 || seat->pointer_state.grab_serial != serial) { + wlr_log(WLR_DEBUG, "Pointer grab serial validation failed: " + "button_count=%"PRIu32" grab_serial=%"PRIu32" (got %"PRIu32")", + seat->pointer_state.button_count, + seat->pointer_state.grab_serial, serial); return false; } if (origin != NULL && seat->pointer_state.focused_surface != origin) { + wlr_log(WLR_DEBUG, "Pointer grab serial validation failed: " + "invalid origin surface"); return false; } diff --git a/types/seat/wlr_seat_touch.c b/types/seat/wlr_seat_touch.c index 486fa55d..75b304a5 100644 --- a/types/seat/wlr_seat_touch.c +++ b/types/seat/wlr_seat_touch.c @@ -365,6 +365,10 @@ bool wlr_seat_validate_touch_grab_serial(struct wlr_seat *seat, struct wlr_touch_point **point_ptr) { if (wlr_seat_touch_num_points(seat) != 1 || seat->touch_state.grab_serial != serial) { + wlr_log(WLR_DEBUG, "Touch grab serial validation failed: " + "num_points=%d grab_serial=%"PRIu32" (got %"PRIu32")", + wlr_seat_touch_num_points(seat), + seat->touch_state.grab_serial, serial); return false; } @@ -378,5 +382,7 @@ bool wlr_seat_validate_touch_grab_serial(struct wlr_seat *seat, } } + wlr_log(WLR_DEBUG, "Touch grab serial validation failed: " + "invalid origin surface"); return false; } |