瀏覽代碼

clipboard: Cleanup coding style

Frank Praznik 1 年之前
父節點
當前提交
d09bf56818
共有 1 個文件被更改,包括 8 次插入6 次删除
  1. 8 6
      src/events/SDL_clipboardevents.c

+ 8 - 6
src/events/SDL_clipboardevents.c

@@ -29,14 +29,16 @@
 void SDL_SendClipboardUpdate(bool owner, char **mime_types, size_t num_mime_types)
 void SDL_SendClipboardUpdate(bool owner, char **mime_types, size_t num_mime_types)
 {
 {
     if (!owner) {
     if (!owner) {
-        // Clear our internal clipboard contents when external clipboard is set
-        /* Wayland sends a data offer to the client from which the clipboard data originated, and as there is no way
-         * to determine the origin of the offer, the clipboard must not be cleared in the case of a recursive offer,
-         * or the original data may be destroyed. Cleanup will be done in the backend when an offer cancellation
-         * event arrives.
+        /* Clear our internal clipboard contents when external clipboard is set.
+         *
+         * Wayland recursively sends a data offer to the client from which the clipboard data originated,
+         * and as the client can't determine the origin of the offer, the clipboard must not be cleared,
+         * or the original data may be destroyed. Cleanup will be done in the backend when an offer
+         * cancellation event arrives.
          */
          */
-        if (SDL_strcmp(SDL_GetCurrentVideoDriver(), "wayland") != 0)
+        if (SDL_strcmp(SDL_GetCurrentVideoDriver(), "wayland") != 0) {
             SDL_CancelClipboardData(0);
             SDL_CancelClipboardData(0);
+        }
 
 
         SDL_SaveClipboardMimeTypes((const char **)mime_types, num_mime_types);
         SDL_SaveClipboardMimeTypes((const char **)mime_types, num_mime_types);
     }
     }