mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-02 09:01:38 -05:00
primary-selection: add a serial argument
The serial needs to be bumped when X11 clients set the selection, otherwise some Wayland clients (e.g. GTK) will overwrite it when they gain focus.
This commit is contained in:
parent
b619ab4d34
commit
06467d2e12
9 changed files with 32 additions and 19 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue