summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb/qxcbconnection.h
diff options
context:
space:
mode:
authorJørgen Lind <jorgen.lind@theqtcompany.com>2015-04-10 12:57:02 +0200
committerJørgen Lind <jorgen.lind@theqtcompany.com>2015-04-15 11:54:34 +0000
commitd605883b5e8e8cb272fab760cd4896d006ce0719 (patch)
tree34e3ac2ca6e7a0db64a98bcf6cb7eb04c283cb8f /src/plugins/platforms/xcb/qxcbconnection.h
parent7432c7c08a6709a12a143d48fbaa9927962edae8 (diff)
Make it possible to use the -visual argument
for xcb applications to use a specific visual id when creating windows. Also make it possible to retrieve the visual id of a specific window with QXcbWindowFunctions::visualId(QWindow *window). UINT_MAX is used as an invalid visualId. Change-Id: If62ada119ce8f9174cc211f53bbf1ce1bb7d021a Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbconnection.h')
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/plugins/platforms/xcb/qxcbconnection.h b/src/plugins/platforms/xcb/qxcbconnection.h
index 91547dd697..e4274eca4d 100644
--- a/src/plugins/platforms/xcb/qxcbconnection.h
+++ b/src/plugins/platforms/xcb/qxcbconnection.h
@@ -370,7 +370,7 @@ class Q_XCB_EXPORT QXcbConnection : public QObject
{
Q_OBJECT
public:
- QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGrabServer, const char *displayName = 0);
+ QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGrabServer, xcb_visualid_t defaultVisualId, const char *displayName = 0);
~QXcbConnection();
QXcbConnection *connection() const { return const_cast<QXcbConnection *>(this); }
@@ -400,8 +400,13 @@ public:
QXcbWMSupport *wmSupport() const { return m_wmSupport.data(); }
xcb_window_t rootWindow();
+
+ bool hasDefaultVisualId() const { return m_defaultVisualId != UINT_MAX; }
+ xcb_visualid_t defaultVisualId() const { return m_defaultVisualId; }
+
#ifdef XCB_USE_XLIB
void *xlib_display() const;
+ void *createVisualInfoForDefaultVisualId() const;
#endif
#if defined(XCB_USE_XINPUT2)
@@ -564,6 +569,7 @@ private:
xcb_connection_t *m_connection;
const xcb_setup_t *m_setup;
bool m_canGrabServer;
+ xcb_visualid_t m_defaultVisualId;
QList<QXcbVirtualDesktop *> m_virtualDesktops;
QList<QXcbScreen *> m_screens;
@@ -632,6 +638,7 @@ private:
};
#define DISPLAY_FROM_XCB(object) ((Display *)(object->connection()->xlib_display()))
+#define CREATE_VISUALINFO_FROM_DEFAULT_VISUALID(object) ((XVisualInfo *)(object->connection()->createVisualInfoForDefaultVisualId()))
template<typename T>
xcb_generic_event_t *QXcbConnection::checkEvent(T &checker)