Revert "Revert "Only set dummy X11 selection if we do not own it""

This reverts commit 1b704b6267.

(the initial reversion was done unintentionally)
This commit is contained in:
Scott Kostyshak 2021-05-04 12:33:30 -04:00
parent 423ddb1199
commit 5d96ee69eb

View 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