From 600b3e3b91185431b92e98f8d3a66ac5465594c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Mon, 11 Mar 2013 11:01:38 +0100 Subject: [PATCH] Xcb port for egl backend Noticed this one during test compile against Qt5 as QX11Info is no longer exposing appVisual. Using the visual from root window which works just fine for this use case. REVIEW: 109411 --- eglonxbackend.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/eglonxbackend.cpp b/eglonxbackend.cpp index 2c1141df32..b0749625e5 100644 --- a/eglonxbackend.cpp +++ b/eglonxbackend.cpp @@ -21,6 +21,7 @@ along with this program. If not, see . // kwin #include "options.h" #include "overlaywindow.h" +#include "xcbutils.h" // kwin libs #include @@ -176,7 +177,11 @@ bool EglOnXBackend::initBufferConfigs() return false; } - EGLint visualId = XVisualIDFromVisual((Visual*)QX11Info::appVisual()); + Xcb::WindowAttributes attribs(rootWindow()); + if (!attribs) { + kError(1212) << "Failed to get window attributes of root window"; + return false; + } config = configs[0]; for (int i = 0; i < count; i++) { @@ -184,7 +189,7 @@ bool EglOnXBackend::initBufferConfigs() if (eglGetConfigAttrib(dpy, configs[i], EGL_NATIVE_VISUAL_ID, &val) == EGL_FALSE) { kError(1212) << "egl get config attrib failed"; } - if (visualId == val) { + if (uint32_t(val) == attribs->visual) { config = configs[i]; break; } @@ -204,7 +209,7 @@ void EglOnXBackend::present() } eglWaitGL(); - XFlush(display()); + xcb_flush(connection()); } void EglOnXBackend::screenGeometryChanged(const QSize &size)