Problem Description:
On Ubuntu Budgie 26.04 (Wayland), copying text and closing the source application prevents pasting within other applications, whereas this issue does not occur on Ubuntu Budgie 24.04 (X11).
According to proper behavior, copied text should be stored in memory, and the software should remain unaffected when closed—this is indeed a bug in Ubuntu 26.04..
You are mistaken. Even X11 copy-paste did not work this way - it worked by requesting the client that owned copied data (selection) to provide it to the client that wanted to paste this data. If the client that owned selection terminated in any way, the data it owned was lost.
The primary difference is that in X11 there was no restriction which client could access the selection so usually there was one dedicated client (clipboard manager) which requested and stored every selected data from all other clients and provided this data on demand. It could even persistently store this data so it became available across restart.
In Wayland up to now only the clients with currently active foreground window were allowed to access selections which made clipboard managers (which normally run in background) impossible.
So it is not as much a bug, as design limitation. Which needs non-trivial amount of developer efforts to implement.
I see you reported it upstream… that will only help you with the next Ubuntu release when a new version of labwc is imported from Debian.
Reporting it to the Ubuntu bugtracker might at least have a chance that a fix gets into the current release (which is why I pointed to the ubuntu-bug tool above).
So it seems like you only need to install cliphist and wl-clipboard, e.g. by running:
sudo apt install cliphist wl-clipboard
create your own autostart entry, log out and back in again.
Systemd Magic to the Rescue
Or, why not make it totally agnostic to the Desktop environment and just make use of systemd user services. Run these commands in a terminal (copy them verbatim by clicking the little “clipboard” icon in the top-right corner, paste into the terminal and press Enter; lines starting with # are comments):
#
# be extra portable and adapt to custom environments
#
usvc_dir=${XDG_CONFIG_HOME:-$HOME/.config}/systemd/user/
#
# create user service directory if it doesn't exist
#
mkdir -p "$usvc_dir"
#
# pushd is like cd but saves the previous directories on a stack
#
pushd "$usvc_dir"
#
# Write wl-clipboard-manager.service unit, using a here-document (<<EOF)
#
cat >wl-clipboard-manager.service <<EOF
[Unit]
# make sure this service is stopped when the desktop session ends
PartOf=graphical-session.target
[Service]
ExecStart=wl-paste --watch cliphist store
# automatically enable in graphical-session.target
[Install]
WantedBy=graphical-session.target
EOF
#
# go back from whence we came, popd being the counterpart of pushd
#
popd
#
# make the service unit known to systemd user service manager
#
systemctl --user daemon-reload
#
# enable the service and start it in one fell swoop
#
systemctl --user enable --now wl-clipboard-manager
The only thing different with Wayland is that this doesn’t come out-of-the-box; nothing that can’t be fixed with a wish list bug report.
bor@ThinkPad-E16-Gen3:~$ wl-paste --watch cat
Watch mode requires a compositor that supports the wlroots data-control protocol
bor@ThinkPad-E16-Gen3:~$
It does not allow you to paste selection in usual way. It requires you to run elaborate command pipeline to interact with cliphist and select what you want to paste. While it can be a valid workaround (or solution to get previous events), it does not exactly answer the original question.
Hopefully in several years when Data control protocol is supported by all major Wayland compositors clipboard management in Wayland will be on par with X11.
The point was to not have to rely on labwc’s way of doing autostart, which looks a little dated. If it’s not supported by a particular compositor the service will simply fail to start; no biggie.
cliphist list | cliphist decode is a shortcut way to get the last entry. The only thing I haven’t figured out yet is how to hook that into the paste shortcut. But I see what you mean. I expected cliphist to somehow take ownership of the clipboard which it doesn’t; I just went with what that GH comment said. There must be other clipboard managers that work like that, I reckon.
Thank you very much for your help, but this method of copying the content, closing the software, and pasting it is ineffective. No problem. Since the Wayland protocol requires that software copying content not be disabled, follow the original approach. Thank you for your response.