]> git.lyx.org Git - lyx.git/commitdiff
Revert "Revert "Only set dummy X11 selection if we do not own it""
authorScott Kostyshak <skostysh@lyx.org>
Tue, 4 May 2021 16:33:30 +0000 (12:33 -0400)
committerScott Kostyshak <skostysh@lyx.org>
Tue, 4 May 2021 16:34:35 +0000 (12:34 -0400)
This reverts commit 1b704b6267bb8144a410c02595887b0731cf4d53.

(the initial reversion was done unintentionally)

src/frontends/qt/GuiSelection.cpp

index 0eb3d5133d7f49b0c5f03eae372997e4f8a7d13c..e10bb476fd5894e480b54701c712c314dba4e1bb 100644 (file)
@@ -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