Check whether it's platform xcb before calling QX11Info::display()

Internally QX11Info::display() calls into QPA native interface and
tries to resolve the nativeResourceForIntegration for "display".
Unfortunately this key also exists in other QPA plugins, e.g. in
QtWayland.

Calling without a check on platform results on wayland qpa in
wl_display* being casted into Display*.

REVIEW: 124203
This commit is contained in:
Nerdopolis Turfwalker 2015-06-29 13:56:38 +02:00 committed by Martin Gräßlin
parent 4c03115882
commit 924b66c4d5

View file

@ -131,7 +131,7 @@ inline
KWIN_EXPORT Display* display()
{
static Display *s_display = nullptr;
if (!s_display) {
if (!s_display && QX11Info::isPlatformX11()) {
s_display = QX11Info::display();
}
return s_display;