summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb/qxcbscreen.cpp
diff options
context:
space:
mode:
authorJørgen Lind <jorgen.lind@digia.com>2013-04-26 08:42:17 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-05-20 07:36:55 +0200
commit0f31a5d91f13bd6a574bed8db894a7ebb2813292 (patch)
tree86ebb63368c04cf6501a5349a83738d72970affd /src/plugins/platforms/xcb/qxcbscreen.cpp
parent3c69751ef237f4ee45623e6d28ddf5b8a19d2b3e (diff)
Introduce QXcbXSettings
This allows you to easily retrieve properties in the XSETTINGS specification. It is also possible to add listeners to get notified when a specific property changes. XSETTINGS is lazy initialized, so it will not be instansiated before someone uses it. For now the intended use is a fallback for finding cursor theme Change-Id: Id47f0613f5876424cd47d721b40da17d3f63429e Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbscreen.cpp')
-rw-r--r--src/plugins/platforms/xcb/qxcbscreen.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/plugins/platforms/xcb/qxcbscreen.cpp b/src/plugins/platforms/xcb/qxcbscreen.cpp
index a6ead49a27..37c6c97bc4 100644
--- a/src/plugins/platforms/xcb/qxcbscreen.cpp
+++ b/src/plugins/platforms/xcb/qxcbscreen.cpp
@@ -44,6 +44,7 @@
#include "qxcbcursor.h"
#include "qxcbimage.h"
#include "qnamespace.h"
+#include "qxcbxsettings.h"
#include <stdio.h>
@@ -68,6 +69,7 @@ QXcbScreen::QXcbScreen(QXcbConnection *connection, xcb_screen_t *scr,
, m_refreshRate(60)
, m_forcedDpi(-1)
, m_hintStyle(QFontEngine::HintStyle(-1))
+ , m_xSettings(0)
{
if (connection->hasXRandr())
xcb_randr_select_input(xcb_connection(), screen()->root, true);
@@ -580,4 +582,12 @@ void QXcbScreen::readXResources()
}
}
+QXcbXSettings *QXcbScreen::xSettings() const
+{
+ if (!m_xSettings) {
+ QXcbScreen *self = const_cast<QXcbScreen *>(this);
+ self->m_xSettings = new QXcbXSettings(self);
+ }
+ return m_xSettings;
+}
QT_END_NAMESPACE