summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rw-r--r--indra/llwindow/llwindowsdl.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp
index 5626707e70..d6afd1853e 100644
--- a/indra/llwindow/llwindowsdl.cpp
+++ b/indra/llwindow/llwindowsdl.cpp
@@ -1407,17 +1407,24 @@ BOOL LLWindowSDL::copyTextToPrimary(const LLWString &text)
BOOL LLWindowSDL::isClipboardTextAvailable()
{
- return FALSE; // unsupported
+ return SDL_HasClipboardText();
}
BOOL LLWindowSDL::pasteTextFromClipboard(LLWString &dst)
{
- return FALSE; // unsupported
+ auto data = SDL_GetClipboardText();
+ if (data)
+ {
+ dst = LLWString(utf8str_to_wstring(data));
+ SDL_free(data);
+ return TRUE;
+ }
+ return FALSE;
}
BOOL LLWindowSDL::copyTextToClipboard(const LLWString &s)
{
- return FALSE; // unsupported
+ return !SDL_SetClipboardText(wstring_to_utf8str(s).c_str());
}
BOOL LLWindowSDL::isPrimaryTextAvailable()