diff options
author | Jorgen Lind <jorgen.lind@digia.com> | 2014-01-23 16:30:34 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-01-23 19:18:35 +0100 |
commit | eeff8f7e7431eea6b6af4133413db2c610dfc123 (patch) | |
tree | f4e152babeb6782d1db008f1b5d62259f4f0b716 | |
parent | 614589d844921e351e5422ba4a9b55aac22566c5 (diff) |
Silence failed xcbxsettings initialization
also add a boolean flag indicating if xsettings is initialized and can
be used
Change-Id: I9dae83b8fef224171744d2b940767cbf54ce4f55
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
-rw-r--r-- | src/plugins/platforms/xcb/qxcbcursor.cpp | 2 | ||||
-rw-r--r-- | src/plugins/platforms/xcb/qxcbxsettings.cpp | 11 | ||||
-rw-r--r-- | src/plugins/platforms/xcb/qxcbxsettings.h | 1 |
3 files changed, 11 insertions, 3 deletions
diff --git a/src/plugins/platforms/xcb/qxcbcursor.cpp b/src/plugins/platforms/xcb/qxcbcursor.cpp index 15e5bf27f1..ce9e445ba2 100644 --- a/src/plugins/platforms/xcb/qxcbcursor.cpp +++ b/src/plugins/platforms/xcb/qxcbcursor.cpp @@ -549,7 +549,7 @@ xcb_cursor_t QXcbCursor::createFontCursor(int cshape) void *dpy = connection()->xlib_display(); // special case for non-standard dnd-* cursors cursor = loadCursor(dpy, cshape); - if (!cursor && !m_gtkCursorThemeInitialized) { + if (!cursor && !m_gtkCursorThemeInitialized && m_screen->xSettings()->initialized()) { QByteArray gtkCursorTheme = m_screen->xSettings()->setting("Gtk/CursorThemeName").toByteArray(); m_screen->xSettings()->registerCallbackForProperty("Gtk/CursorThemeName",cursorThemePropertyChanged,this); if (updateCursorTheme(dpy,gtkCursorTheme)) { diff --git a/src/plugins/platforms/xcb/qxcbxsettings.cpp b/src/plugins/platforms/xcb/qxcbxsettings.cpp index 8679d502d9..141a6cc0cb 100644 --- a/src/plugins/platforms/xcb/qxcbxsettings.cpp +++ b/src/plugins/platforms/xcb/qxcbxsettings.cpp @@ -99,6 +99,7 @@ class QXcbXSettingsPrivate public: QXcbXSettingsPrivate(QXcbScreen *screen) : screen(screen) + , initialized(false) { } @@ -202,6 +203,7 @@ public: QXcbScreen *screen; xcb_window_t x_settings_window; QMap<QByteArray, QXcbXSettingsPropertyValue> settings; + bool initialized; }; @@ -217,7 +219,6 @@ QXcbXSettings::QXcbXSettings(QXcbScreen *screen) xcb_generic_error_t *error = 0; xcb_intern_atom_reply_t *atom_reply = xcb_intern_atom_reply(screen->xcb_connection(),atom_cookie,&error); if (error) { - qWarning() << Q_FUNC_INFO << "Failed to find XSETTINGS_S atom"; free(error); return; } @@ -230,7 +231,6 @@ QXcbXSettings::QXcbXSettings(QXcbScreen *screen) xcb_get_selection_owner_reply_t *selection_result = xcb_get_selection_owner_reply(screen->xcb_connection(), selection_cookie, &error); if (error) { - qWarning() << Q_FUNC_INFO << "Failed to get selection owner for XSETTINGS_S atom"; free(error); return; } @@ -246,6 +246,13 @@ QXcbXSettings::QXcbXSettings(QXcbScreen *screen) xcb_change_window_attributes(screen->xcb_connection(),d_ptr->x_settings_window,event,event_mask); d_ptr->populateSettings(d_ptr->getSettings()); + d_ptr->initialized = true; +} + +bool QXcbXSettings::initialized() const +{ + Q_D(const QXcbXSettings); + return d->initialized; } void QXcbXSettings::handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) diff --git a/src/plugins/platforms/xcb/qxcbxsettings.h b/src/plugins/platforms/xcb/qxcbxsettings.h index 16fed862bc..f6a07a6091 100644 --- a/src/plugins/platforms/xcb/qxcbxsettings.h +++ b/src/plugins/platforms/xcb/qxcbxsettings.h @@ -53,6 +53,7 @@ class QXcbXSettings : public QXcbWindowEventListener Q_DECLARE_PRIVATE(QXcbXSettings) public: QXcbXSettings(QXcbScreen *screen); + bool initialized() const; QVariant setting(const QByteArray &property) const; |