I couldn't really come up with a good summary, as the reproducer is a bit complex. While debugging bug 125809, I found the following crash, easiest reproducible with Draw. 1. Start Draw from a terminal 2. Open galleries sidebar 3. Drag anything from the Sidebar into the document. The new item will be and has to stay selected! 4. Drag anything from the Sidebar into the document again. The new item will be and has to stay selected! - on the terminal you'll see: "QXcbClipboard::setMimeData: Cannot set X11 selection owner" - at this point the Qt5 internal selection state doesn't match the LO state anymore. 5. Close and discard the document without removing the selection (Ctrl + w) 6. Close the start center (Ctrl + w). 7. Crash when QApplication tries to release the LO selection on shutdown. LO normally release the clipboard when closing a module (Draw). This doesn't happen correctly now. The simple workaround is to select something else before closing the document, so the clipboard state is corrected. Clearing the clipboard somehow interferes with the D'n'D action when there is already a selection. I tried to understand, why the setMimeData() call after the clear() fails, but came up with nothing. I guess the someone else (clipboard manager?) claims the clipboard after LO gives it up with the clear(). The current fix is to queue the clear and ignore it, if it's directly followed by a claiming setContent. This initially "nice" Qt5Clipboard code already feels like it needs some refactoring to make it easier to follow...
I can reproduce with master as of commit 7de7512718ac192fcad441d5500d056316f72d72.
There is some additional discussion in the proposed patch: https://gerrit.libreoffice.org/c/core/+/90990
Jan-Marek Glogowski committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/313081c0703c66918e95640c74cd57312a1e8bba tdf#131533 Qt5 defer dropping clipboard ownership It will be available in 7.0.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Jan-Marek Glogowski committed a patch related to this issue. It has been pushed to "libreoffice-6-4": https://git.libreoffice.org/core/commit/dbe45b7930dc027cf6d143dbb34390c469808e10 tdf#131533 Qt5 defer dropping clipboard ownership It will be available in 6.4.4. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.