From f09f2f240f008151c560bfb9cfe5cfe3d7889ac4 Mon Sep 17 00:00:00 2001 From: Gatis Paeglis Date: Wed, 31 May 2017 15:36:22 +0200 Subject: 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 Reviewed-by: Laszlo Agocs --- src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxwindow.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxwindow.cpp') 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(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; -- cgit v1.2.3