From f14dfc8462325e57604c4e0767b5a4d6a91776cc Mon Sep 17 00:00:00 2001 From: Joseph Cloutier Date: Tue, 7 Jun 2022 13:36:35 -0400 Subject: [PATCH] Work around unreliable clipboard on Linux. Most likely SDL_waylandvideo.c is to blame, but I don't know enough to rule out SDL_x11video.c. --- src/lime/system/Clipboard.hx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/lime/system/Clipboard.hx b/src/lime/system/Clipboard.hx index cb66fc2ee..0d8013c55 100644 --- a/src/lime/system/Clipboard.hx +++ b/src/lime/system/Clipboard.hx @@ -56,6 +56,14 @@ class Clipboard #if (flash || js || html5) __update(); + #elseif linux + // Hack: SDL won't start calling __update until set_text() + // is called once. + if (_text == null) + { + __update(); + set_text(_text); + } #end return _text;