Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions changelog/unreleased/12534.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Bugfix: Fix "Copy private link to clipboard" on native Wayland sessions

The "Copy private link to clipboard" action now correctly writes to the
clipboard on native Wayland sessions. Previously the write was silently
dropped by the Wayland compositor because the ownCloud daemon has no
compositor surface.

https://github.com/owncloud/client/issues/12534
6 changes: 6 additions & 0 deletions src/gui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -230,4 +230,10 @@ if(UNIX AND NOT APPLE)
if(SharedMimeInfo_FOUND)
update_xdg_mimetypes( ${KDE_INSTALL_DATADIR}/mime/packages )
endif(SharedMimeInfo_FOUND)

option(BUNDLE_WL_COPY "Bundle wl-copy for self-contained builds such as AppImage" OFF)
if(BUNDLE_WL_COPY)
find_program(WL_COPY_EXECUTABLE wl-copy REQUIRED)
install(PROGRAMS ${WL_COPY_EXECUTABLE} DESTINATION ${KDE_INSTALL_BINDIR})
endif()
endif()
12 changes: 11 additions & 1 deletion src/gui/socketapi/socketapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#include <QDir>
#include <QFile>
#include <QFileDialog>
#include <QFileInfo>
#include <QLocalSocket>
#include <QMessageBox>
#include <QMetaMethod>
Expand All @@ -54,6 +55,7 @@
#include <QBuffer>

#include <QClipboard>
#include <QProcess>

#ifdef Q_OS_MAC
#include <CoreFoundation/CoreFoundation.h>
Expand Down Expand Up @@ -672,7 +674,15 @@ void SocketApi::command_OPEN_PRIVATE_LINK_VERSIONS(const QString &localFile, Soc

void SocketApi::copyUrlToClipboard(const QUrl &link)
{
QApplication::clipboard()->setText(link.toString());
if (!qgetenv("WAYLAND_DISPLAY").isEmpty()) {
QString wlCopy = QApplication::applicationDirPath() + QStringLiteral("/wl-copy");
if (!QFileInfo::exists(wlCopy)) {
wlCopy = QStringLiteral("wl-copy");
}
QProcess::startDetached(wlCopy, {link.toString()});
} else {
QApplication::clipboard()->setText(link.toString());
}
}

void SocketApi::command_MAKE_AVAILABLE_LOCALLY(const QString &filesArg, SocketListener *)
Expand Down