Update StarMainApplication_sdl.cpp
This commit is contained in:
parent
b52d7405f2
commit
65cf738832
@ -458,9 +458,15 @@ private:
|
|||||||
: parent(parent) {}
|
: parent(parent) {}
|
||||||
|
|
||||||
Maybe<String> getClipboard() override {
|
Maybe<String> getClipboard() override {
|
||||||
if (SDL_HasClipboardText())
|
Maybe<String> string;
|
||||||
return String(SDL_GetClipboardText());
|
if (SDL_HasClipboardText()) {
|
||||||
return {};
|
auto text = SDL_GetClipboardText();
|
||||||
|
if (text && *text != NULL) {
|
||||||
|
string.emplace(text);
|
||||||
|
SDL_free(text);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return string;
|
||||||
}
|
}
|
||||||
|
|
||||||
void setClipboard(String text) override {
|
void setClipboard(String text) override {
|
||||||
|
Loading…
Reference in New Issue
Block a user