seat: Create inert objects for missing capabilities

We should throw a protocol error if the relevant capability has never
existed when get_(pointer|keyboard|touch) is called. Otherwise, it
should succeed, even if the capability is not currently present.

This follows the spec, and avoids possible races with the client when
capabilities are lost.

Closes: https://github.com/swaywm/wlroots/issues/2227
This commit is contained in:
Kenny Levinsen 2020-05-28 00:24:50 +02:00 committed by Simon Ser
parent d66b9966e9
commit 5e0ef70cc0
5 changed files with 25 additions and 9 deletions

View file

@ -214,6 +214,7 @@ struct wlr_seat {
char *name;
uint32_t capabilities;
uint32_t accumulated_capabilities;
struct timespec last_event;
struct wlr_data_source *selection_source;