From 5f3f2a96fdd87ee0395cad9252b44c3ca3a06285 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sun, 7 Feb 2021 13:53:03 -0600 Subject: [PATCH] Improve detection of having no clipboard text --- app/streaming/input/keyboard.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/streaming/input/keyboard.cpp b/app/streaming/input/keyboard.cpp index 9575e6bd..bf4d7942 100644 --- a/app/streaming/input/keyboard.cpp +++ b/app/streaming/input/keyboard.cpp @@ -92,8 +92,8 @@ void SdlInputHandler::performPendingSpecialKeyCombo() { SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, "Detected paste text combo"); - const char* text = SDL_GetClipboardText(); - if (text != nullptr) { + const char* text; + if (SDL_HasClipboardText() && (text = SDL_GetClipboardText()) != nullptr) { // Reset pending key combo before pasting, // otherwise it will ignore our keypresses. m_PendingKeyCombo = KeyComboMax;