Add more debug output around starting the x clipboard syncer process

Summary:
Trying to get some more information on why the related test fails on
build.kde.org.

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16748
This commit is contained in:
Martin Flöser 2018-11-08 08:43:50 +01:00
parent c19627b492
commit 543b6955d4

View file

@ -565,6 +565,7 @@ int WaylandServer::createXclipboardSyncConnection()
void WaylandServer::setupX11ClipboardSync() void WaylandServer::setupX11ClipboardSync()
{ {
if (m_xclipbaordSync.process) { if (m_xclipbaordSync.process) {
qCWarning(KWIN_CORE) << "Tried to start x clipboard syncer although process already started";
return; return;
} }
@ -572,6 +573,7 @@ void WaylandServer::setupX11ClipboardSync()
if (socket == -1) { if (socket == -1) {
delete m_xclipbaordSync.client; delete m_xclipbaordSync.client;
m_xclipbaordSync.client = nullptr; m_xclipbaordSync.client = nullptr;
qCWarning(KWIN_CORE) << "Could not create wayland socket for x clipboard syncer";
return; return;
} }
if (socket >= 0) { if (socket >= 0) {
@ -580,10 +582,11 @@ void WaylandServer::setupX11ClipboardSync()
environment.insert(QStringLiteral("DISPLAY"), QString::fromUtf8(qgetenv("DISPLAY"))); environment.insert(QStringLiteral("DISPLAY"), QString::fromUtf8(qgetenv("DISPLAY")));
environment.remove("WAYLAND_DISPLAY"); environment.remove("WAYLAND_DISPLAY");
m_xclipbaordSync.process = new Process(this); m_xclipbaordSync.process = new Process(this);
m_xclipbaordSync.process->setProcessChannelMode(QProcess::ForwardedErrorChannel); m_xclipbaordSync.process->setProcessChannelMode(QProcess::ForwardedChannels);
auto finishedSignal = static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished); auto finishedSignal = static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished);
connect(m_xclipbaordSync.process, finishedSignal, this, connect(m_xclipbaordSync.process, finishedSignal, this,
[this] { [this] {
qCDebug(KWIN_CORE) << "X clipboard syncer process finished";
m_xclipbaordSync.process->deleteLater(); m_xclipbaordSync.process->deleteLater();
m_xclipbaordSync.process = nullptr; m_xclipbaordSync.process = nullptr;
m_xclipbaordSync.ddi.clear(); m_xclipbaordSync.ddi.clear();
@ -596,8 +599,10 @@ void WaylandServer::setupX11ClipboardSync()
// start from build directory if executable is available there (e.g. autotests), otherwise start libexec executable // 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")}; const QFileInfo clipboardSync{QDir{QCoreApplication::applicationDirPath()}, QStringLiteral("org_kde_kwin_xclipboard_syncer")};
if (clipboardSync.exists()) { if (clipboardSync.exists()) {
qCDebug(KWIN_CORE) << "Starting" << clipboardSync.absoluteFilePath();
m_xclipbaordSync.process->start(clipboardSync.absoluteFilePath()); m_xclipbaordSync.process->start(clipboardSync.absoluteFilePath());
} else { } else {
qCDebug(KWIN_CORE) << "Starting" << KWIN_XCLIPBOARD_SYNC_BIN;
m_xclipbaordSync.process->start(QStringLiteral(KWIN_XCLIPBOARD_SYNC_BIN)); m_xclipbaordSync.process->start(QStringLiteral(KWIN_XCLIPBOARD_SYNC_BIN));
} }
} }