From 3ba1b989a6c7e22e8f0b92c59c5bbb52cdcab638 Mon Sep 17 00:00:00 2001 From: Tomasz Olszak Date: Fri, 9 Jan 2015 22:20:02 +0100 Subject: xcb: build fix when XCB_USE_XLIB is not defined. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When XCB_USE_XLIB was not defined QXcbXSettings still used XIproto.h. This change removes XIProto.h dependency and leaves QXcbXSettings uninitialized when XCB_USE_XLIB is not defined. QXcbXSettings::initialize() is already used in other parts of code e.g. qxcbcursor.cpp. Change-Id: I48eb82e39c5c091b41e8ec19e742a21d41de2610 Reviewed-by: Jørgen Lind --- src/plugins/platforms/xcb/qxcbxsettings.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/plugins/platforms/xcb') diff --git a/src/plugins/platforms/xcb/qxcbxsettings.cpp b/src/plugins/platforms/xcb/qxcbxsettings.cpp index 13d42832db..a1dadb0e54 100644 --- a/src/plugins/platforms/xcb/qxcbxsettings.cpp +++ b/src/plugins/platforms/xcb/qxcbxsettings.cpp @@ -36,7 +36,9 @@ #include #include +#ifdef XCB_USE_XLIB #include +#endif //XCB_USE_XLIB QT_BEGIN_NAMESPACE /* Implementation of http://standards.freedesktop.org/xsettings-spec/xsettings-0.5.html */ @@ -138,6 +140,7 @@ public: return value + 4 - remainder; } +#ifdef XCB_USE_XLIB void populateSettings(const QByteArray &xSettings) { if (xSettings.length() < 12) @@ -212,6 +215,7 @@ public: } } +#endif //XCB_USE_XLIB QXcbScreen *screen; xcb_window_t x_settings_window; @@ -258,8 +262,10 @@ QXcbXSettings::QXcbXSettings(QXcbScreen *screen) const uint32_t event_mask[] = { XCB_EVENT_MASK_STRUCTURE_NOTIFY|XCB_EVENT_MASK_PROPERTY_CHANGE }; xcb_change_window_attributes(screen->xcb_connection(),d_ptr->x_settings_window,event,event_mask); +#ifdef XCB_USE_XLIB d_ptr->populateSettings(d_ptr->getSettings()); d_ptr->initialized = true; +#endif //XCB_USE_XLIB } QXcbXSettings::~QXcbXSettings() @@ -279,7 +285,9 @@ void QXcbXSettings::handlePropertyNotifyEvent(const xcb_property_notify_event_t Q_D(QXcbXSettings); if (event->window != d->x_settings_window) return; +#ifdef XCB_USE_XLIB d->populateSettings(d->getSettings()); +#endif //XCB_USE_XLIB } void QXcbXSettings::registerCallbackForProperty(const QByteArray &property, QXcbXSettings::PropertyChangeFunc func, void *handle) -- cgit v1.2.3