Skip to content

Commit 0dd92fd

Browse files
DeepDiver1975claude
andcommitted
feat: add GET_PRIVATE_LINK socket command for Wayland clipboard support
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>
1 parent 201e336 commit 0dd92fd

2 files changed

Lines changed: 17 additions & 0 deletions

File tree

src/gui/socketapi/socketapi.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,22 @@ void SocketApi::command_COPY_PRIVATE_LINK(const QString &localFile, SocketListen
493493
fetchPrivateLinkUrlHelper(localFile, &SocketApi::copyUrlToClipboard);
494494
}
495495

496+
void SocketApi::command_GET_PRIVATE_LINK(const QString &localFile, SocketListener *listener)
497+
{
498+
QSharedPointer<SocketListener> sharedListener;
499+
for (const auto &l : std::as_const(_listeners)) {
500+
if (l.data() == listener) {
501+
sharedListener = l;
502+
break;
503+
}
504+
}
505+
fetchPrivateLinkUrlHelper(localFile, [sharedListener](const QUrl &url) {
506+
if (sharedListener) {
507+
sharedListener->sendMessage(QStringLiteral("PRIVATE_LINK:") + url.toString());
508+
}
509+
});
510+
}
511+
496512
void SocketApi::command_EMAIL_PRIVATE_LINK(const QString &localFile, SocketListener *)
497513
{
498514
fetchPrivateLinkUrlHelper(localFile, &SocketApi::emailPrivateLink);

src/gui/socketapi/socketapi.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ private Q_SLOTS:
116116
// The context menu actions
117117
Q_INVOKABLE void command_SHARE(const QString &localFile, SocketListener *listener);
118118
Q_INVOKABLE void command_COPY_PRIVATE_LINK(const QString &localFile, SocketListener *listener);
119+
Q_INVOKABLE void command_GET_PRIVATE_LINK(const QString &localFile, SocketListener *listener);
119120
Q_INVOKABLE void command_EMAIL_PRIVATE_LINK(const QString &localFile, SocketListener *listener);
120121
Q_INVOKABLE void command_OPEN_PRIVATE_LINK(const QString &localFile, SocketListener *listener);
121122
Q_INVOKABLE void command_OPEN_PRIVATE_LINK_VERSIONS(const QString &localFile, SocketListener *listener);

0 commit comments

Comments
 (0)