diff --git a/wayland_server.cpp b/wayland_server.cpp --- a/wayland_server.cpp +++ b/wayland_server.cpp @@ -63,6 +63,8 @@ // Qt +#include +#include #include #include @@ -590,7 +592,13 @@ } ); m_xclipbaordSync.process->setProcessEnvironment(environment); - m_xclipbaordSync.process->start(QStringLiteral(KWIN_XCLIPBOARD_SYNC_BIN)); + // start from build directory if executable is available there (e.g. autotests), otherwise start libexec executable + const QFileInfo clipboardSync{QDir{QCoreApplication::applicationDirPath()}, QStringLiteral("org_kde_kwin_xclipboard_syncer")}; + if (clipboardSync.exists()) { + m_xclipbaordSync.process->start(clipboardSync.absoluteFilePath()); + } else { + m_xclipbaordSync.process->start(QStringLiteral(KWIN_XCLIPBOARD_SYNC_BIN)); + } } }