diff --git a/src/plugins/platforms/xcb/qxcbintegration.cpp b/src/plugins/platforms/xcb/qxcbintegration.cpp index e10c556473..cef81ddfec 100644 --- a/src/plugins/platforms/xcb/qxcbintegration.cpp +++ b/src/plugins/platforms/xcb/qxcbintegration.cpp @@ -443,7 +443,7 @@ QByteArray QXcbIntegration::wmClass() const return m_wmClass; } -#ifndef QT_NO_SESSIONMANAGER +#if !defined(QT_NO_SESSIONMANAGER) && defined(XCB_USE_SM) QPlatformSessionManager *QXcbIntegration::createPlatformSessionManager(const QString &id, const QString &key) const { return new QXcbSessionManager(id, key); diff --git a/src/plugins/platforms/xcb/qxcbintegration.h b/src/plugins/platforms/xcb/qxcbintegration.h index 7fd5756fd5..7ca7befc64 100644 --- a/src/plugins/platforms/xcb/qxcbintegration.h +++ b/src/plugins/platforms/xcb/qxcbintegration.h @@ -101,7 +101,7 @@ public: QByteArray wmClass() const; -#ifndef QT_NO_SESSIONMANAGER +#if !defined(QT_NO_SESSIONMANAGER) && defined(XCB_USE_SM) QPlatformSessionManager *createPlatformSessionManager(const QString &id, const QString &key) const Q_DECL_OVERRIDE; #endif diff --git a/src/plugins/platforms/xcb/xcb-plugin.pro b/src/plugins/platforms/xcb/xcb-plugin.pro index 341c33e8e6..4f69ca8aab 100644 --- a/src/plugins/platforms/xcb/xcb-plugin.pro +++ b/src/plugins/platforms/xcb/xcb-plugin.pro @@ -74,6 +74,7 @@ contains(QT_CONFIG, xcb-render) { # build with session management support contains(QT_CONFIG, xcb-sm) { + DEFINES += XCB_USE_SM LIBS += -lSM -lICE SOURCES += qxcbsessionmanager.cpp HEADERS += qxcbsessionmanager.h