]> source.dussan.org Git - tigervnc.git/commit
Completely ignore server clipboard when unfocused
authorPierre Ossman <ossman@cendio.se>
Mon, 11 Sep 2023 11:05:25 +0000 (13:05 +0200)
committerPierre Ossman <ossman@cendio.se>
Mon, 11 Sep 2023 11:05:25 +0000 (13:05 +0200)
commit8d2739fa71eaf7a28d63ac62583e8087c66a5247
tree5b43dbed76ee77d9a6ddf2f0db5d7da75c5fe3ed
parent963f11e3130c0dbf60b7d8df4bd119ab0b6bed40
Completely ignore server clipboard when unfocused

We can get races with clipboard managers in the server that is very
confusing to the user.

When the clipboard changes locally, we tell the server to drop the old
clipboard (as it is now lost). But we don't send over the new clipboard
until we get focus again, in order to not leak more data than necessary.
This causes some clibpoard managers to take over ownership in order to
avoid an empty clipboard. And this takes precedence over the new client
clipboard as it happened later. Effectively reverting the clipboard the
user sees.

Avoid all of this by simply ignoring the server when we don't have
focus. This is likely what users expect anyway as they expect their
currently focused application to control the clipboard, not vncviewer in
the background.
vncviewer/Viewport.cxx
vncviewer/Viewport.h