aboutsummaryrefslogtreecommitdiff
path: root/include/wlr
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2019-01-22 20:13:01 +0100
committerGitHub <noreply@github.com>2019-01-22 20:13:01 +0100
commit365a75139c382b3627ee96eade827038b1a2bc1a (patch)
tree655ec06e18dd09a72322b5bb650230154e4708cf /include/wlr
parent62658a318dedb3e0803092baa4685a80687249d0 (diff)
parent06467d2e1233d8c2830500ca399bcce8dd37a91b (diff)
Merge pull request #1485 from emersion/data-device-serial
primary-selection: add a serial argument
Diffstat (limited to 'include/wlr')
-rw-r--r--include/wlr/types/wlr_data_device.h6
-rw-r--r--include/wlr/types/wlr_gtk_primary_selection.h1
-rw-r--r--include/wlr/types/wlr_primary_selection.h8
-rw-r--r--include/wlr/types/wlr_seat.h1
4 files changed, 12 insertions, 4 deletions
diff --git a/include/wlr/types/wlr_data_device.h b/include/wlr/types/wlr_data_device.h
index 9c4ce995..209d917d 100644
--- a/include/wlr/types/wlr_data_device.h
+++ b/include/wlr/types/wlr_data_device.h
@@ -166,8 +166,10 @@ void wlr_data_device_manager_destroy(struct wlr_data_device_manager *manager);
void wlr_seat_client_send_selection(struct wlr_seat_client *seat_client);
/**
- * Sets the current selection for the seat. This removes the previous one if
- * there was any.
+ * Sets the current selection for the seat. NULL can be provided to clear it.
+ * This removes the previous one if there was any. In case the selection doesn't
+ * come from a client, wl_display_next_serial() can be used to generate a
+ * serial.
*/
void wlr_seat_set_selection(struct wlr_seat *seat,
struct wlr_data_source *source, uint32_t serial);
diff --git a/include/wlr/types/wlr_gtk_primary_selection.h b/include/wlr/types/wlr_gtk_primary_selection.h
index 436a50d2..7cf34201 100644
--- a/include/wlr/types/wlr_gtk_primary_selection.h
+++ b/include/wlr/types/wlr_gtk_primary_selection.h
@@ -36,7 +36,6 @@ struct wlr_gtk_primary_selection_device {
struct wl_list resources; // wl_resource_get_link
struct wl_list offers; // wl_resource_get_link
- uint32_t selection_serial;
struct wl_listener seat_destroy;
struct wl_listener seat_focus_change;
diff --git a/include/wlr/types/wlr_primary_selection.h b/include/wlr/types/wlr_primary_selection.h
index 9be61acc..a2b23574 100644
--- a/include/wlr/types/wlr_primary_selection.h
+++ b/include/wlr/types/wlr_primary_selection.h
@@ -48,7 +48,13 @@ void wlr_primary_selection_source_send(
struct wlr_primary_selection_source *source, const char *mime_type,
int fd);
+/**
+ * Sets the current primary selection for the seat. NULL can be provided to
+ * clear it. This removes the previous one if there was any. In case the
+ * selection doesn't come from a client, wl_display_next_serial() can be used to
+ * generate a serial.
+ */
void wlr_seat_set_primary_selection(struct wlr_seat *seat,
- struct wlr_primary_selection_source *source);
+ struct wlr_primary_selection_source *source, uint32_t serial);
#endif
diff --git a/include/wlr/types/wlr_seat.h b/include/wlr/types/wlr_seat.h
index 942a3420..1ad5542e 100644
--- a/include/wlr/types/wlr_seat.h
+++ b/include/wlr/types/wlr_seat.h
@@ -200,6 +200,7 @@ struct wlr_seat {
uint32_t selection_serial;
struct wlr_primary_selection_source *primary_selection_source;
+ uint32_t primary_selection_serial;
// `drag` goes away before `drag_source`, when the implicit grab ends
struct wlr_drag *drag;