瀏覽代碼

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

Ethan Lee 5 年之前
父節點
當前提交
cf12496311
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      src/video/wayland/SDL_waylandclipboard.c

+ 2 - 1
src/video/wayland/SDL_waylandclipboard.c

@@ -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) {