wayland: Fall back to clipboard source data if offer came up empty

This commit is contained in:
Ethan Lee 2021-04-08 15:29:54 -04:00 committed by Sam Lantinga
parent 282c052479
commit cf12496311
1 changed files with 2 additions and 1 deletions

View File

@ -80,7 +80,8 @@ Wayland_GetClipboardText(_THIS)
if (length > 0) { if (length > 0) {
text = (char*) buffer; text = (char*) buffer;
} }
} else if (data_device->selection_source != NULL) { }
if (length == 0 && data_device->selection_source != NULL) {
buffer = Wayland_data_source_get_data(data_device->selection_source, buffer = Wayland_data_source_get_data(data_device->selection_source,
&length, TEXT_MIME, SDL_TRUE); &length, TEXT_MIME, SDL_TRUE);
if (length > 0) { if (length > 0) {