mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-17 03:28:57 +00:00
wayland: Use the implicit grab serial when clearing the clipboard
Some compositors won't clear the selection without a valid serial.
(cherry picked from commit 9094395b13)
This commit is contained in:
parent
9b1843c8da
commit
bfe3abdc26
1 changed files with 4 additions and 2 deletions
|
|
@ -34,6 +34,8 @@
|
|||
|
||||
#include "SDL_waylandvideo.h"
|
||||
#include "SDL_waylanddatamanager.h"
|
||||
|
||||
#include "SDL_waylandevents_c.h"
|
||||
#include "primary-selection-unstable-v1-client-protocol.h"
|
||||
|
||||
/* FIXME: This is arbitrary, but we want this to be less than a frame because
|
||||
|
|
@ -524,7 +526,7 @@ bool Wayland_data_device_clear_selection(SDL_WaylandDataDevice *data_device)
|
|||
if (!data_device || !data_device->data_device) {
|
||||
result = SDL_SetError("Invalid Data Device");
|
||||
} else if (data_device->selection_source) {
|
||||
wl_data_device_set_selection(data_device->data_device, NULL, 0);
|
||||
wl_data_device_set_selection(data_device->data_device, NULL, data_device->video_data->input->last_implicit_grab_serial);
|
||||
Wayland_data_source_destroy(data_device->selection_source);
|
||||
data_device->selection_source = NULL;
|
||||
}
|
||||
|
|
@ -539,7 +541,7 @@ bool Wayland_primary_selection_device_clear_selection(SDL_WaylandPrimarySelectio
|
|||
result = SDL_SetError("Invalid Primary Selection Device");
|
||||
} else if (primary_selection_device->selection_source) {
|
||||
zwp_primary_selection_device_v1_set_selection(primary_selection_device->primary_selection_device,
|
||||
NULL, 0);
|
||||
NULL, primary_selection_device->video_data->input->last_implicit_grab_serial);
|
||||
Wayland_primary_selection_source_destroy(primary_selection_device->selection_source);
|
||||
primary_selection_device->selection_source = NULL;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue