fix: use wl-copy for clipboard writes on native Wayland sessions#12536
fix: use wl-copy for clipboard writes on native Wayland sessions#12536jb0421 wants to merge 2 commits into
Conversation
On Wayland the ownCloud daemon has no compositor surface and never receives keyboard focus, so QClipboard::setText() is silently dropped by the compositor when COPY_PRIVATE_LINK is handled. Detect a native Wayland session via WAYLAND_DISPLAY and delegate the clipboard write to wl-copy(1), which does not require a compositor surface. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
|
Interesting approach indeed ..... requires wl-copy to be installed .... also needs to be ltested with the appimage - I guess we would need wl-copy to be packaged into the app image ... |
|
@DeepDiver1975 Should I create a new PR with |
feel free to give it a shot - thank you |
5d10c84 to
4e5e57e
Compare
On Wayland, look for wl-copy next to the application binary first (covers self-contained builds like AppImage), then fall back to PATH. Add BUNDLE_WL_COPY cmake option to install wl-copy alongside the client binary during packaging. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
4e5e57e to
b99fc81
Compare
|
@DeepDiver1975 Now it bundles |
Summary
Fixes #12534
On native Wayland sessions,
QApplication::clipboard()->setText()is silentlydropped by the compositor when the ownCloud daemon has no focused surface — which
is always the case when the command arrives via the socket from a file manager
shell integration.
This change detects a native Wayland session via
WAYLAND_DISPLAYand delegatesthe clipboard write to
wl-copy(1), which uses the Wayland primary selectionprotocol and does not require a compositor surface.
Changes
copyUrlToClipboard(): fall back towl-copywhenWAYLAND_DISPLAYis set#include <QProcess>Testing
Tested manually on Ubuntu 24.04 LTS (GNOME Wayland, Nautilus 46.4) with a locally
built client:
Notes
wl-copyis provided by thewl-clipboardpackage, which is available on allmajor Linux distributions and is a common dependency for Wayland clipboard tools.
If
wl-copyis not installed,QProcess::startDetachedsilently fails and theclipboard write is lost — same behaviour as before this fix.
See also: owncloud/client-desktop-shell-integration-nautilus#11 (comment)