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/qxcbwindow.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/plugins/platforms/xcb/qxcbwindow.cpp') diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp index 9921ed5da5..e5fb6fb9ad 100644 --- a/src/plugins/platforms/xcb/qxcbwindow.cpp +++ b/src/plugins/platforms/xcb/qxcbwindow.cpp @@ -590,7 +590,7 @@ void QXcbWindow::create() #ifdef XCB_USE_XLIB // force sync to read outstanding requests - see QTBUG-29106 - XSync(DISPLAY_FROM_XCB(platformScreen), false); + XSync(static_cast(platformScreen->connection()->xlib_display()), false); #endif #ifndef QT_NO_DRAGANDDROP @@ -1502,9 +1502,10 @@ void QXcbWindow::setWindowTitle(const QString &title) ba.constData()); #ifdef XCB_USE_XLIB - XTextProperty *text = qstringToXTP(DISPLAY_FROM_XCB(this), title); + Display *dpy = static_cast(connection()->xlib_display()); + XTextProperty *text = qstringToXTP(dpy, title); if (text) - XSetWMName(DISPLAY_FROM_XCB(this), m_window, text); + XSetWMName(dpy, m_window, text); #endif xcb_flush(xcb_connection()); } -- cgit v1.2.3