QubesOS / qubes-issues

The Qubes OS Project issue tracker
https://www.qubes-os.org/doc/issue-tracking/
532 stars 46 forks source link

Preserve intra-qube clipboard contents after the program copied from exits #6961

Open qwrd opened 2 years ago

qwrd commented 2 years ago

Qubes OS release

4.0, 4.1

Brief summary

Hello,

I've noticed an annoyance in Qubes, and I'm hoping this can be fixed somehow.... has already caused me some minor data loss. Anyway, if you copy some text from a certain window and then close that window before pasting the text to another window within the same qube, the clipboard contents will be lost. I've been able to reproduce this on the Debian 10 and Fedora 30 templates on Q4.0 as well as Debian 11 and Fedora 34 on Q4.1-rc1. Not sure why this is the case, but I recall some old debian versions had this problem.

Testing this on Ubuntu 20.04 LTS (outside QubesOS) works fine, the clipboard remembers the copied text. Same behavior on a Windows PC.

Steps to reproduce

Expected behavior

The system should remember the clipboard contents in a qube even after the window that the contents have been copied from has been closed, and the process exited. This is the default behavior on many other operating systems.

Actual behavior

Clipboard contents are lost after the program that initially contained the contents exits.

unman commented 2 years ago

I'm afraid that this is not a bug, but in accord with the freedesktop specification:

A remaining somewhat odd thing about X selections is that exiting the
app you did a cut/copy from removes the cut/copied data from the
clipboard, since the selection protocol is asynchronous and requires
the source app to provide the data at paste time. The solution here
would be a standardized protocol for a "clipboard daemon" so that apps
could hand off their data to a daemon when they exit. Or
alternatively, you can run an application such as xclipboard which
constantly "harvests" clipboard selections.

If your copy of Ubuntu doesn't show this behaviour, then they have probably installed a clipboard manager. You could install one if you want, but it isn't a default install.

qwrd commented 2 years ago

Interesting. Now that you mention it, I think I do vaguely remember someone talking to me about this about a decade ago. So, with this in mind, I was wondering, if it is in the interest of Qubes to mimic this behavior by default since it is a common behavior on multiple other operating systems. But considering Qubes already has some form of inter-qube clipboard manager, I was wondering, if this topic would fit into that category i.e. rather than installing some 3-rd party clipboard daemon, should this rather be a part of the qubes clipboard management?

unman commented 2 years ago

On Wed, Oct 13, 2021 at 01:34:52AM -0700, qwrd wrote:

Interesting. Now that you mention it, I think I do vaguely remember someone talking to me about this about a decade ago. So, with this in mind, I was wondering, if it is in the interest of Qubes to mimic this behavior by default since it is a common behavior on multiple other operating systems. But considering Qubes already has some form of inter-qube clipboard manager, I was wondering, if this topic would fit into that category i.e. rather than installing some 3-rd party clipboard daemon, should this rather be a part of the qubes clipboard management?

Personally, I wouldn't want to see Qubes getting dirty in individual qube clipboards. But #3415 envisages exactly this,#5778 covered lots of ground in this area (perhaps too much), and assorted other clipboard related issues hover around it. @andrewdavidwong ?

andrewdavidwong commented 2 years ago

Personally, I wouldn't want to see Qubes getting dirty in individual qube clipboards.

I am inclined to agree (also see here, though this request is rather modest compared to many others).

But #3415 envisages exactly this,#5778 covered lots of ground in this area (perhaps too much), and assorted other clipboard related issues hover around it. @andrewdavidwong ?

Fair points. I'll leave it up to the devs to decide.

ninavizz commented 2 years ago

Thx for filing this, @qwrd! I tend to agree—but also, amnesiac properties in Qubes, generally, I feel need to be clearer. This feels "accidental" (per how it was built, differently from how users are 'trained' in other operating systems to expect). Thx too, to @unman for clarifying this is a freedesktop issue. Adding this to the "Clipboard Experience" project here, for consideration once we get funding to improve the clipboard here (not a low priority, fwiw).

unman commented 2 years ago

I assume it is on "To Do" for consideration, rather than to be done.