feat: add GET_PRIVATE_LINK socket command for Wayland clipboard support#12535
Open
DeepDiver1975 wants to merge 5 commits intomasterfrom
Open
feat: add GET_PRIVATE_LINK socket command for Wayland clipboard support#12535DeepDiver1975 wants to merge 5 commits intomasterfrom
DeepDiver1975 wants to merge 5 commits intomasterfrom
Conversation
|
Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes. |
2 tasks
Sends PRIVATE_LINK:<url> back over the socket so that file manager extensions running inside processes with a valid Wayland surface can write to the clipboard themselves, working around the compositor serial requirement that prevents the background daemon from doing so. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
cff9221 to
413bd02
Compare
The test duplicated the Unix socket path logic, which broke on macOS where socketApiSocketPath() returns an XPC-style name instead of a filesystem path. Use the canonical helper so the test connects to the same socket the server listens on across all platforms. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
Without OWNCLOUDGUI_EXPORT the symbol had hidden visibility and was not exported, causing an undefined symbol linker error when SocketApiTest tried to call it on macOS. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
The previous test used QLocalSocket to connect to the SocketApi server, which doesn't work on macOS where the server uses an XPC-based transport instead of a local socket file. Replace with direct invocation of command_GET_PRIVATE_LINK via QMetaObject::invokeMethod, capturing output in a QBuffer backed SocketListener. This is a pure unit test of the command handler with no dependency on the platform-specific socket transport. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On native Wayland sessions the ownCloud daemon has no compositor surface.
QApplication::clipboard()->setText()requires a valid Waylandwl_data_deviceserialfrom a recent input event, but a tray-only app (system tray via
StatusNotifierItem)never receives seat events and so never has one. The compositor silently drops the
clipboard write. Copy private link to clipboard is broken for all users on Wayland.
Qt 6.9+ added
zwlr-data-controlsupport as a partial fix (QT_WAYLAND_USE_DATA_CONTROL=1),but it requires an environment variable and only works on KDE/wlroots compositors — not on
GNOME/Mutter, which is the primary affected environment.
Solution
Add
GET_PRIVATE_LINK:<file>→PRIVATE_LINK:<url>to the socket protocol. File managerextensions that run inside processes with a real Wayland surface (Nautilus, Dolphin) can
request the URL and write to the clipboard themselves.
The command reuses
fetchPrivateLinkUrlHelper()— ~7 lines of new production code.COPY_PRIVATE_LINKis unchanged for X11 and for extensions that do not yet use the newcommand.
Related
Backward compatibility
GET_PRIVATE_LINKtimes out (3 s), falls through toCOPY_PRIVATE_LINKCOPY_PRIVATE_LINK)