Steps to reproduce: 1. Connect using the ThinLinc client on Windows 2. In the session, open the app QGIS and open the default project "Bee Farming" 3. On the Windows side (client-side), copy a image 4. Notice that the QGIS app freezes, (the rest of the ThinLinc session is functional)
Note: The "default project" mentioned above is not part of the QGIS. It was downloaded separately from here https://docs.qfield.org/get-started/sample-projects/
The following log messages can be seen when reproducing according to Comment 0: vncviewer: > Tue Oct 01 11:30:04 2024 > Viewport: Local clipboard changed whilst not focused, will notify server > later > > Tue Oct 01 11:30:06 2024 > Viewport: Focus regained after local clipboard change, notifying server Xvnc: > Tue Oct 1 11:30:04 2024 > Selection: Remote clipboard lost, removing local ownership > > Tue Oct 1 11:30:06 2024 > Selection: Remote clipboard announced, grabbing local ownership > Selection: Grabbed PRIMARY selection > Selection: Grabbed CLIPBOARD selection > Selection: Selection request for PRIMARY (type TARGETS) > Selection: Selection request for PRIMARY (type UTF8_STRING) > Selection: Requesting clipboard data from client > > Tue Oct 1 11:30:11 2024 > Selection: Selection request for PRIMARY (type UTF8_STRING) > Selection: Requesting clipboard data from client > > Tue Oct 1 11:30:16 2024 > Selection: Selection request for PRIMARY (type UTF8_STRING) > Selection: Requesting clipboard data from client > > Tue Oct 1 11:30:21 2024 > Selection: Selection request for CLIPBOARD (type TARGETS) After some digging, I found that FLTK has support for reading either plaintext or images from the clipboard [1]. The process is like this: 1. We use Fl::add_clipboard_notify() to get notified of clipboard changes on the client OS. 2. The handler for this event in vncviewer, Viewport::handleClipboardChange(), will announce to the VNC server — that clipboard data is available. 3. When the server gets this notification, it will, in turn, announce to applications in the session, that clipboard is available. 4. The application asks for clipboard in this case, so the VNC server will send back a request for a clipboard sync to the viewer, via vncRequestClipboard() in vncSelection.c. 5. The viewer receives the clipboardRequest and calls handleClipboardRequest() from CMsgReader::readExtendedClipboard(). 6. A few layers in, Viewport::handleClipboardRequest() calls Fl::paste() which emits the FL_PASTE event. 7. In the handling of this event, in Viewport::handle(), there is some filtering that likely only let plain text clipboard data get sent. The problem for the QGIS application seems to occur when it has been notified by the VNC server that clipboard is available, and then doesn't get anything after asking for it. [1]: https://www.fltk.org/doc-1.3/group__fl__clipboard.html#gaa01ff0cf95384f8255fa80edcbe1432d
Simply preventing the viewer from sending the "announceClipboard" message to the server seems to help in this case. I fixed it in upstream TigerVNC: https://github.com/TigerVNC/tigervnc/pull/1840