| 1220 | } |
| 1221 | |
| 1222 | void SDLClipboard::SetText(const StringView& text) |
| 1223 | { |
| 1224 | if (CommandLine::Options.Headless.IsTrue()) |
| 1225 | return; |
| 1226 | auto mainWindow = Engine::MainWindow; |
| 1227 | if (!mainWindow) |
| 1228 | return; |
| 1229 | |
| 1230 | if (X11Impl::xDisplay) |
| 1231 | { |
| 1232 | X11Impl::ClipboardText.Set(text.Get(), text.Length()); |
| 1233 | X11Impl::ClipboardData.Clear(); |
| 1234 | X11Impl::ClipboardFiles.Clear(); |
| 1235 | |
| 1236 | X11::Window window = (X11::Window)(mainWindow->GetNativePtr()); |
| 1237 | X11::XSetSelectionOwner(X11Impl::xDisplay, X11Impl::xAtomClipboard, window, CurrentTime); // CLIPBOARD |
| 1238 | //X11::XSetSelectionOwner(xDisplay, xAtomPrimary, window, CurrentTime); // XA_PRIMARY |
| 1239 | X11::XFlush(X11Impl::xDisplay); |
| 1240 | } |
| 1241 | else |
| 1242 | { |
| 1243 | SDL_SetClipboardText(StringAnsi(text).GetText()); |
| 1244 | } |
| 1245 | } |
| 1246 | |
| 1247 | void SDLClipboard::SetRawData(const Span<byte>& data) |
| 1248 | { |
nothing calls this directly
no test coverage detected