diff options
author | Simon Ser <contact@emersion.fr> | 2024-02-29 11:38:34 +0100 |
---|---|---|
committer | Alexander Orzechowski <alex@ozal.ski> | 2024-02-29 11:33:06 +0000 |
commit | 091c6e09b1bbca6dc7d7191f92a375c4524bba64 (patch) | |
tree | 491d9925412a0d98768e31ef9a573b976175daaf | |
parent | ee70932422718809da88700536d4a7ddde024813 (diff) |
tablet-v2: only send id event is vendor is set
Some tablets may not have a USB vendor/product set.
References: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/issues/180#note_2303637
-rw-r--r-- | types/tablet_v2/wlr_tablet_v2_tablet.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/types/tablet_v2/wlr_tablet_v2_tablet.c b/types/tablet_v2/wlr_tablet_v2_tablet.c index 184570f6..4c49c20b 100644 --- a/types/tablet_v2/wlr_tablet_v2_tablet.c +++ b/types/tablet_v2/wlr_tablet_v2_tablet.c @@ -102,13 +102,14 @@ void add_tablet_client(struct wlr_tablet_seat_client_v2 *seat, client, destroy_tablet_v2); zwp_tablet_seat_v2_send_tablet_added(seat->resource, client->resource); - // Send the expected events if (tablet->wlr_tablet->base.name) { zwp_tablet_v2_send_name(client->resource, tablet->wlr_tablet->base.name); } - zwp_tablet_v2_send_id(client->resource, - tablet->wlr_device->vendor, tablet->wlr_device->product); + if (tablet->wlr_device->vendor != 0) { + zwp_tablet_v2_send_id(client->resource, + tablet->wlr_device->vendor, tablet->wlr_device->product); + } const char **path_ptr; wl_array_for_each(path_ptr, &tablet->wlr_tablet->paths) { |