]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt/GuiSelection.cpp
Fix completion in math when inline completion was not yet shown
[lyx.git] / src / frontends / qt / GuiSelection.cpp
index 288cb18432cfbc7eb8a763b0acf42b4b136146d9..e10bb476fd5894e480b54701c712c314dba4e1bb 100644 (file)
@@ -51,14 +51,15 @@ 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
-       //else
        //      qApp->clipboard()->clear(QClipboard::Selection);
+       // when own is false.
        // Since we do not issue this call we rather implement
        // "persistent selections" as far as X is concerned.
 }