Guard X11 access in supportInformation

Caused crash when running KWin without X11 support.
This commit is contained in:
Martin Flöser 2017-11-01 15:09:40 +01:00
parent 54565a94bd
commit 018afd092a

View file

@ -1403,9 +1403,10 @@ QString Workspace::supportInformation() const
#endif
support.append(QStringLiteral("\n"));
if (auto c = kwinApp()->x11Connection()) {
support.append(QStringLiteral("X11\n"));
support.append(QStringLiteral("===\n"));
auto x11setup = xcb_get_setup(connection());
auto x11setup = xcb_get_setup(c);
support.append(QStringLiteral("Vendor: %1\n").arg(QString::fromUtf8(QByteArray::fromRawData(xcb_setup_vendor(x11setup), xcb_setup_vendor_length(x11setup)))));
support.append(QStringLiteral("Vendor Release: %1\n").arg(x11setup->release_number));
support.append(QStringLiteral("Protocol Version/Revision: %1/%2\n").arg(x11setup->protocol_major_version).arg(x11setup->protocol_minor_version));
@ -1416,6 +1417,7 @@ QString Workspace::supportInformation() const
.arg(QString::number(e.version, 16)));
}
support.append(QStringLiteral("\n"));
}
if (auto bridge = Decoration::DecorationBridge::self()) {
support.append(QStringLiteral("Decoration\n"));