summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxwindow.cpp
diff options
context:
space:
mode:
authorGatis Paeglis <gatis.paeglis@qt.io>2017-05-31 15:36:22 +0200
committerGatis Paeglis <gatis.paeglis@qt.io>2017-06-27 18:09:35 +0000
commitf09f2f240f008151c560bfb9cfe5cfe3d7889ac4 (patch)
treebbdf2e7b732bb89eabca4b1e27f602ff662a305b /src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxwindow.cpp
parentac098eef427e20b35f14b0b3f84483e7828d07d4 (diff)
xcb: remove DISPLAY_FROM_XCB macro
... as it does not add much value and is not widely used. and cleanup code: - where we repeatedly (for no good reason) call DISPLAY_FROM_XCB, instead of storing display as a (member) variable. - inconsistency where we (in the same function) alternatingly use DISPLAY_FROM_XCB and variable holding pointer to Display (when both refer to the same display). In other places this patch replaces macros with code they would translate to (or with minor adjustments to keep sensible line length). Change-Id: Ieb2a3e055892dcf31f132891f83ed4a665e3fa6e Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxwindow.cpp')
-rw-r--r--src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxwindow.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxwindow.cpp b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxwindow.cpp
index 61fed6f5e3..145a11a5e3 100644
--- a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxwindow.cpp
+++ b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxwindow.cpp
@@ -62,7 +62,8 @@ const xcb_visualtype_t *QXcbGlxWindow::createVisual()
qDebug(lcQpaGl) << "Requested format before FBConfig/Visual selection:" << m_format;
- const char *glxExts = glXQueryExtensionsString(DISPLAY_FROM_XCB(scr), scr->screenNumber());
+ Display *dpy = static_cast<Display *>(scr->connection()->xlib_display());
+ const char *glxExts = glXQueryExtensionsString(dpy, scr->screenNumber());
int flags = 0;
if (glxExts) {
qCDebug(lcQpaGl, "Available GLX extensions: %s", glxExts);
@@ -70,7 +71,7 @@ const xcb_visualtype_t *QXcbGlxWindow::createVisual()
flags |= QGLX_SUPPORTS_SRGB;
}
- XVisualInfo *visualInfo = qglx_findVisualInfo(DISPLAY_FROM_XCB(scr), scr->screenNumber(), &m_format, GLX_WINDOW_BIT, flags);
+ XVisualInfo *visualInfo = qglx_findVisualInfo(dpy, scr->screenNumber(), &m_format, GLX_WINDOW_BIT, flags);
if (!visualInfo) {
qWarning() << "No XVisualInfo for format" << m_format;
return Q_NULLPTR;