diff --git a/include/seat.h b/include/seat.h index 4faf0fc..850d68e 100644 --- a/include/seat.h +++ b/include/seat.h @@ -26,6 +26,9 @@ struct seat { uint32_t id; uint32_t capabilities; char name[256]; + + void (*on_capability_change)(struct seat*); + void* userdata; }; struct seat* seat_new(struct wl_seat* wl_seat, uint32_t id); diff --git a/src/seat.c b/src/seat.c index d6bf333..020d7fc 100644 --- a/src/seat.c +++ b/src/seat.c @@ -29,6 +29,9 @@ static void seat_capabilities(void* data, struct wl_seat* wl_seat, struct seat* self = data; self->capabilities = capabilities; + + if (self->on_capability_change) + self->on_capability_change(self); } static void seat_name(void* data, struct wl_seat* wl_seat, const char* name)