From 7f3a5980c1d54988a707b961fd2ef647cebb4c5b Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Sat, 10 Apr 2021 15:09:25 +0300 Subject: [PATCH] qt: Do not use QClipboard::Selection on Windows and macOS. Windows and macOS do not support the global mouse selection. --- src/qt/guiutil.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp index b4afdbcc22..a5d0f244ce 100644 --- a/src/qt/guiutil.cpp +++ b/src/qt/guiutil.cpp @@ -628,8 +628,11 @@ bool SetStartOnSystemStartup(bool fAutoStart) { return false; } void setClipboard(const QString& str) { - QApplication::clipboard()->setText(str, QClipboard::Clipboard); - QApplication::clipboard()->setText(str, QClipboard::Selection); + QClipboard* clipboard = QApplication::clipboard(); + clipboard->setText(str, QClipboard::Clipboard); + if (clipboard->supportsSelection()) { + clipboard->setText(str, QClipboard::Selection); + } } fs::path qstringToBoostPath(const QString &path)