Selaa lähdekoodia

Don't cleanup clipboard in SDL_SendClipboardUpdate on Wayland

hwsmm 6 kuukautta sitten
vanhempi
commit
bb748ef2d9
1 muutettua tiedostoa jossa 4 lisäystä ja 1 poistoa
  1. 4 1
      src/events/SDL_clipboardevents.c

+ 4 - 1
src/events/SDL_clipboardevents.c

@@ -30,7 +30,10 @@ void SDL_SendClipboardUpdate(bool owner, char **mime_types, size_t num_mime_type
 {
     if (!owner) {
         // Clear our internal clipboard contents when external clipboard is set
-        SDL_CancelClipboardData(0);
+        // Wayland: https://github.com/libsdl-org/SDL/issues/12152
+        if (SDL_strcmp(SDL_GetCurrentVideoDriver(), "wayland") != 0)
+            SDL_CancelClipboardData(0);
+
         SDL_SaveClipboardMimeTypes((const char **)mime_types, num_mime_types);
     }