From 1e6222f0e29af3b055a1bd953deefcfd64696777 Mon Sep 17 00:00:00 2001 From: Robin Burchell Date: Wed, 4 Oct 2017 15:46:52 +0200 Subject: [PATCH] QGtkIntegration: Remove X display hack Don't try pretend to be X when not really X. This is probably going to break in very scary ways, and the one usecase for it (Krita) hardcodes xcb at present anyway. --- src/qgtkintegration.cpp | 14 ++++---------- src/qgtkintegration.h | 2 -- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/src/qgtkintegration.cpp b/src/qgtkintegration.cpp index 8b44753..ceb5dc1 100644 --- a/src/qgtkintegration.cpp +++ b/src/qgtkintegration.cpp @@ -226,14 +226,11 @@ void *QGtkIntegration::nativeResourceForIntegration(const QByteArray &resource) qWarning() << "XCB connection requested; this is experimental, and may not work well."; xcb_warned = true; } - Display *dpy; + Display *dpy = nullptr; if (GDK_IS_X11_DISPLAY(m_display)) { dpy = gdk_x11_display_get_xdisplay(m_display); } else { - if (!m_xDisplay) { - m_xDisplay = XOpenDisplay(nullptr); - } - dpy = (Display*)m_xDisplay; + qWarning() << "Can't get XCB connection, GDK_BACKEND is not X11."; } xcb_connection_t *conn = XGetXCBConnection(dpy); result = reinterpret_cast(conn); @@ -245,14 +242,11 @@ void *QGtkIntegration::nativeResourceForIntegration(const QByteArray &resource) qWarning() << "X11 display handle; this is experimental, and may not work well."; x11_warned = true; } - Display *dpy; + Display *dpy = nullptr; if (GDK_IS_X11_DISPLAY(m_display)) { dpy = gdk_x11_display_get_xdisplay(m_display); } else { - if (!m_xDisplay) { - m_xDisplay = XOpenDisplay(nullptr); - } - dpy = (Display*)m_xDisplay; + qWarning() << "Can't get XCB connection, GDK_BACKEND is not X11."; } result = reinterpret_cast(dpy); #endif diff --git a/src/qgtkintegration.h b/src/qgtkintegration.h index 901ff03..f2cf627 100644 --- a/src/qgtkintegration.h +++ b/src/qgtkintegration.h @@ -38,7 +38,6 @@ #include typedef void *EGLDisplay; -typedef void *XDisplay;; QT_BEGIN_NAMESPACE @@ -90,7 +89,6 @@ class QGtkIntegration : public QPlatformIntegration, public QPlatformNativeInter QGtkClipboard *m_clipboard = nullptr; EGLDisplay m_eglDisplay; // non-null for wayland platforms - XDisplay m_xDisplay = nullptr; // used in the native platform interface }; QT_END_NAMESPACE