Merge pull request #1158 from BjossiAlfreds/sdl3-clipboard-fix

Small fix for SDL3 API change for SetClipboardText
This commit is contained in:
Yamagi 2024-11-10 14:47:08 +01:00 committed by GitHub
commit b31d187166
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 2 deletions

View file

@ -2441,8 +2441,11 @@ IN_GetClipboardText(char *out, size_t n)
SDL_free(s);
}
/* Copy string s to the clipboard.
Returns 0 on success, 1 otherwise.
*/
int
IN_SetClipboardText(const char *s)
{
return SDL_SetClipboardText(s);
return SDL_SetClipboardText(s) != 0;
}

View file

@ -2437,8 +2437,13 @@ IN_GetClipboardText(char *out, size_t n)
SDL_free(s);
}
/* Copy string s to the clipboard.
Returns 0 on success, 1 otherwise.
*/
int
IN_SetClipboardText(const char *s)
{
return SDL_SetClipboardText(s);
bool res = SDL_SetClipboardText(s);
return !res;
}