diff --git a/uwac/include/uwac/uwac.h b/uwac/include/uwac/uwac.h index 5042803cc..6a85bc7e5 100644 --- a/uwac/include/uwac/uwac.h +++ b/uwac/include/uwac/uwac.h @@ -37,6 +37,7 @@ typedef struct uwac_display UwacDisplay; typedef struct uwac_output UwacOutput; typedef struct uwac_window UwacWindow; typedef struct uwac_seat UwacSeat; +typedef uint32_t UwacSeatId; /** @brief error codes */ @@ -111,7 +112,12 @@ struct uwac_new_seat_event { }; typedef struct uwac_new_seat_event UwacSeatNewEvent; -typedef struct uwac_new_seat_event UwacSeatRemovedEvent; + +struct uwac_removed_seat_event { + int type; + UwacSeatId id; +}; +typedef struct uwac_removed_seat_event UwacSeatRemovedEvent; struct uwac_keyboard_enter_event { int type; @@ -213,6 +219,7 @@ union uwac_event { int type; UwacOutputNewEvent output_new; UwacSeatNewEvent seat_new; + UwacSeatRemovedEvent seat_removed; UwacPointerEnterLeaveEvent mouse_enter_leave; UwacPointerMotionEvent mouse_motion; UwacPointerButtonEvent mouse_button; @@ -479,6 +486,14 @@ UWAC_API UwacReturnCode UwacNextEvent(UwacDisplay *display, UwacEvent *event); */ UWAC_API const char *UwacSeatGetName(const UwacSeat *seat); +/** + * returns the id of the given UwacSeat + * + * @param seat the UwacSeat + * @return the id of the seat + */ +UWAC_API UwacSeatId UwacSeatGetId(const UwacSeat *seat); + #ifdef __cplusplus } #endif diff --git a/uwac/libuwac/uwac-display.c b/uwac/libuwac/uwac-display.c index 677d12386..cd2ee5211 100644 --- a/uwac/libuwac/uwac-display.c +++ b/uwac/libuwac/uwac-display.c @@ -270,7 +270,7 @@ static void registry_handle_global_remove(void* data, struct wl_registry* regist ev = (UwacSeatRemovedEvent*)UwacDisplayNewEvent(d, UWAC_EVENT_REMOVED_SEAT); if (ev) - ev->seat = seat; + ev->id = name; } wl_list_remove(&global->link); diff --git a/uwac/libuwac/uwac-input.c b/uwac/libuwac/uwac-input.c index 8daf7174e..ecb3b1a6c 100644 --- a/uwac/libuwac/uwac-input.c +++ b/uwac/libuwac/uwac-input.c @@ -865,3 +865,7 @@ void UwacSeatDestroy(UwacSeat *s) { const char *UwacSeatGetName(const UwacSeat *seat) { return seat->name; } + +UwacSeatId UwacSeatGetId(const UwacSeat *seat) { + return seat->seat_id; +}