Skip to content
This repository has been archived by the owner on Jul 23, 2020. It is now read-only.

Commit

Permalink
QGtkIntegration: Remove X display hack
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
rburchell committed Oct 4, 2017
1 parent d491c37 commit 1e6222f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
14 changes: 4 additions & 10 deletions src/qgtkintegration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<void*>(conn);
Expand All @@ -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<void*>(dpy);
#endif
Expand Down
2 changes: 0 additions & 2 deletions src/qgtkintegration.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
#include <gdk/gdk.h>

typedef void *EGLDisplay;
typedef void *XDisplay;;

QT_BEGIN_NAMESPACE

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 1e6222f

Please sign in to comment.