From d605883b5e8e8cb272fab760cd4896d006ce0719 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Fri, 10 Apr 2015 12:57:02 +0200 Subject: 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 --- src/platformheaders/xcbfunctions/qxcbwindowfunctions.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/platformheaders/xcbfunctions') diff --git a/src/platformheaders/xcbfunctions/qxcbwindowfunctions.h b/src/platformheaders/xcbfunctions/qxcbwindowfunctions.h index f9008039a1..ae05cf52a9 100644 --- a/src/platformheaders/xcbfunctions/qxcbwindowfunctions.h +++ b/src/platformheaders/xcbfunctions/qxcbwindowfunctions.h @@ -72,6 +72,17 @@ public: if (func) func(window, type); } + + typedef uint (*VisualId)(QWindow *window); + static const QByteArray visualIdIdentifier() { return QByteArrayLiteral("XcbVisualId"); } + + static uint visualId(QWindow *window) + { + QXcbWindowFunctions::VisualId func = reinterpret_cast(QGuiApplication::platformFunction(visualIdIdentifier())); + if (func) + return func(window); + return UINT_MAX; + } }; -- cgit v1.2.3