gtk-primary-selection: support multiple devices

When a client was creating multiple data devices for the same seat, we were
only creating one resource. This is a protocol error.

Instead, create one offer per data device.

This commit also makes offers inert when their source is destroyed.

Fixes part of https://github.com/swaywm/wlroots/issues/1041
Supersedes https://github.com/swaywm/wlroots/pull/1113
This commit is contained in:
emersion 2018-11-21 10:59:11 +01:00
parent 040d62de00
commit b9a2e4ba4c
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48
2 changed files with 40 additions and 59 deletions

View file

@ -24,8 +24,6 @@ struct wlr_primary_selection_device_manager {
void *data;
};
struct wlr_primary_selection_offer;
struct wlr_primary_selection_source {
// source metadata
struct wl_array mime_types;
@ -36,7 +34,6 @@ struct wlr_primary_selection_source {
void (*cancel)(struct wlr_primary_selection_source *source);
// source status
struct wlr_primary_selection_offer *offer;
struct wlr_seat_client *seat_client;
struct {