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