From: Scott Kostyshak Date: Tue, 4 May 2021 16:33:30 +0000 (-0400) Subject: Revert "Revert "Only set dummy X11 selection if we do not own it"" X-Git-Tag: 2.4-Beta1~27 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=5d96ee69eb9173779932575cb6d6ce70db9860b9;p=lyx.git Revert "Revert "Only set dummy X11 selection if we do not own it"" This reverts commit 1b704b6267bb8144a410c02595887b0731cf4d53. (the initial reversion was done unintentionally) --- diff --git a/src/frontends/qt/GuiSelection.cpp b/src/frontends/qt/GuiSelection.cpp index 0eb3d5133d..e10bb476fd 100644 --- a/src/frontends/qt/GuiSelection.cpp +++ b/src/frontends/qt/GuiSelection.cpp @@ -51,9 +51,10 @@ void GuiSelection::haveSelection(bool own) // an application actually requests it. // This way calling Selection::have() is cheap and we can do it as // often as we want. - //LYXERR(Debug::SELECTION, "GuiSelection: setting dummy selection"); - if (own) + if (own && !qApp->clipboard()->ownsSelection()) { + LYXERR(Debug::SELECTION, "GuiSelection: setting dummy selection"); qApp->clipboard()->setText(QString(), QClipboard::Selection); + } // We don't need to do anything if own = false, as this case is // handled by QT. // FIXME (gb): This is wrong. What is missing here is rather a call of