diff --git a/src/opengl/gl2paintengineex/qglengineshadersource_p.h b/src/opengl/gl2paintengineex/qglengineshadersource_p.h
index 1aacc96..fc8b9ef 100644
--- a/src/opengl/gl2paintengineex/qglengineshadersource_p.h
+++ b/src/opengl/gl2paintengineex/qglengineshadersource_p.h
@@ -148,7 +148,7 @@ static const char* const qglslAffinePositionWithPatternBrushVertexShader
                  = qglslPositionWithPatternBrushVertexShader;
 
 static const char* const qglslPatternBrushSrcFragmentShader = "\n\
-    uniform   lowp    sampler2D brushTexture; \n\
+    uniform           sampler2D brushTexture; \n\
     uniform   lowp    vec4      patternColor; \n\
     varying   highp   vec2      patternTexCoords;\n\
     lowp vec4 srcPixel() \n\
@@ -183,7 +183,7 @@ static const char* const qglslAffinePositionWithLinearGradientBrushVertexShader
                  = qglslPositionWithLinearGradientBrushVertexShader;
 
 static const char* const qglslLinearGradientBrushSrcFragmentShader = "\n\
-    uniform   lowp    sampler2D brushTexture; \n\
+    uniform           sampler2D brushTexture; \n\
     varying   mediump float     index; \n\
     lowp vec4 srcPixel() \n\
     { \n\
@@ -218,7 +218,7 @@ static const char* const qglslAffinePositionWithConicalGradientBrushVertexShader
 
 static const char* const qglslConicalGradientBrushSrcFragmentShader = "\n\
     #define INVERSE_2PI 0.1591549430918953358 \n\
-    uniform   lowp    sampler2D brushTexture; \n\
+    uniform           sampler2D brushTexture; \n\
     uniform   mediump float     angle; \n\
     varying   highp   vec2      A; \n\
     lowp vec4 srcPixel() \n\
@@ -260,7 +260,7 @@ static const char* const qglslAffinePositionWithRadialGradientBrushVertexShader
                  = qglslPositionWithRadialGradientBrushVertexShader;
 
 static const char* const qglslRadialGradientBrushSrcFragmentShader = "\n\
-    uniform   lowp    sampler2D brushTexture; \n\
+    uniform           sampler2D brushTexture; \n\
     uniform   highp   float     fmp2_m_radius2; \n\
     uniform   highp   float     inverse_2_fmp2_m_radius2; \n\
     varying   highp   float     b; \n\
@@ -304,14 +304,14 @@ static const char* const qglslAffinePositionWithTextureBrushVertexShader
 // TODO: Special case POT textures which don't need this emulation
 static const char* const qglslTextureBrushSrcFragmentShader = "\n\
     varying highp   vec2      brushTextureCoords; \n\
-    uniform lowp    sampler2D brushTexture; \n\
+    uniform         sampler2D brushTexture; \n\
     lowp vec4 srcPixel() { \n\
         return texture2D(brushTexture, fract(brushTextureCoords)); \n\
     }\n";
 #else
 static const char* const qglslTextureBrushSrcFragmentShader = "\n\
     varying   highp   vec2      brushTextureCoords; \n\
-    uniform   lowp    sampler2D brushTexture; \n\
+    uniform           sampler2D brushTexture; \n\
     lowp vec4 srcPixel() \n\
     { \n\
         return texture2D(brushTexture, brushTextureCoords); \n\
@@ -321,7 +321,7 @@ static const char* const qglslTextureBrushSrcFragmentShader = "\n\
 static const char* const qglslTextureBrushSrcWithPatternFragmentShader = "\n\
     varying   highp   vec2      brushTextureCoords; \n\
     uniform   lowp    vec4      patternColor; \n\
-    uniform   lowp    sampler2D brushTexture; \n\
+    uniform           sampler2D brushTexture; \n\
     lowp vec4 srcPixel() \n\
     { \n\
         return patternColor * (1.0 - texture2D(brushTexture, brushTextureCoords).r); \n\
@@ -337,7 +337,7 @@ static const char* const qglslSolidBrushSrcFragmentShader = "\n\
 
 static const char* const qglslImageSrcFragmentShader = "\n\
     varying   highp   vec2      textureCoords; \n\
-    uniform   lowp    sampler2D imageTexture; \n\
+    uniform           sampler2D imageTexture; \n\
     lowp vec4 srcPixel() \n\
     { \n"
         "return texture2D(imageTexture, textureCoords); \n"
@@ -345,7 +345,7 @@ static const char* const qglslImageSrcFragmentShader = "\n\
 
 static const char* const qglslCustomSrcFragmentShader = "\n\
     varying   highp   vec2      textureCoords; \n\
-    uniform   lowp    sampler2D imageTexture; \n\
+    uniform           sampler2D imageTexture; \n\
     lowp vec4 srcPixel() \n\
     { \n\
         return customShader(imageTexture, textureCoords); \n\
@@ -354,7 +354,7 @@ static const char* const qglslCustomSrcFragmentShader = "\n\
 static const char* const qglslImageSrcWithPatternFragmentShader = "\n\
     varying   highp   vec2      textureCoords; \n\
     uniform   lowp    vec4      patternColor; \n\
-    uniform   lowp    sampler2D imageTexture; \n\
+    uniform           sampler2D imageTexture; \n\
     lowp vec4 srcPixel() \n\
     { \n\
         return patternColor * (1.0 - texture2D(imageTexture, textureCoords).r); \n\
@@ -362,7 +362,7 @@ static const char* const qglslImageSrcWithPatternFragmentShader = "\n\
 
 static const char* const qglslNonPremultipliedImageSrcFragmentShader = "\n\
     varying   highp   vec2      textureCoords; \n\
-    uniform   lowp    sampler2D imageTexture; \n\
+    uniform          sampler2D imageTexture; \n\
     lowp vec4 srcPixel() \n\
     { \n\
         lowp vec4 sample = texture2D(imageTexture, textureCoords); \n\
@@ -454,7 +454,7 @@ static const char* const qglslMainFragmentShader = "\n\
 
 static const char* const qglslMaskFragmentShader = "\n\
     varying   highp   vec2      textureCoords;\n\
-    uniform   lowp    sampler2D maskTexture;\n\
+    uniform           sampler2D maskTexture;\n\
     lowp vec4 applyMask(lowp vec4 src) \n\
     {\n\
         lowp vec4 mask = texture2D(maskTexture, textureCoords); \n\
@@ -478,7 +478,7 @@ static const char* const qglslMaskFragmentShader = "\n\
 
 static const char* const qglslRgbMaskFragmentShaderPass1 = "\n\
     varying   highp   vec2      textureCoords;\n\
-    uniform   lowp    sampler2D maskTexture;\n\
+    uniform           sampler2D maskTexture;\n\
     lowp vec4 applyMask(lowp vec4 src) \n\
     { \n\
         lowp vec4 mask = texture2D(maskTexture, textureCoords); \n\
@@ -487,7 +487,7 @@ static const char* const qglslRgbMaskFragmentShaderPass1 = "\n\
 
 static const char* const qglslRgbMaskFragmentShaderPass2 = "\n\
     varying   highp   vec2      textureCoords;\n\
-    uniform   lowp    sampler2D maskTexture;\n\
+    uniform           sampler2D maskTexture;\n\
     lowp vec4 applyMask(lowp vec4 src) \n\
     { \n\
         lowp vec4 mask = texture2D(maskTexture, textureCoords); \n\
diff --git a/src/plugins/platforms/wayland/qwaylandcursor.cpp b/src/plugins/platforms/wayland/qwaylandcursor.cpp
index 29c6abd..f51281d 100644
--- a/src/plugins/platforms/wayland/qwaylandcursor.cpp
+++ b/src/plugins/platforms/wayland/qwaylandcursor.cpp
@@ -48,7 +48,7 @@
 
 #include <QtGui/QImageReader>
 
-#define DATADIR "/home/jlind/install/share"
+#define DATADIR "/usr/share"
 
 static const struct pointer_image {
     const char *filename;
diff --git a/src/plugins/platforms/wayland/qwaylanddrmsurface.cpp b/src/plugins/platforms/wayland/qwaylanddrmsurface.cpp
index 76c8c33..603c018 100644
--- a/src/plugins/platforms/wayland/qwaylanddrmsurface.cpp
+++ b/src/plugins/platforms/wayland/qwaylanddrmsurface.cpp
@@ -77,7 +77,6 @@ QWaylandDrmBuffer::QWaylandDrmBuffer(QWaylandDisplay *display,
 
     mImage = eglCreateDRMImageMESA(mDisplay->eglDisplay(), imageAttribs);
 
-    glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, mImage);
     glGenTextures(1, &mTexture);
     glBindTexture(GL_TEXTURE_2D, mTexture);
     glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, mImage);
@@ -112,7 +111,6 @@ QWaylandDrmBuffer::~QWaylandDrmBuffer(void)
 void QWaylandDrmBuffer::bindToCurrentFbo()
 {
     Q_ASSERT(QPlatformGLContext::currentContext());
-    glBindTexture(GL_TEXTURE_2D, mTexture);
     glFramebufferTexture2D(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0,
                            GL_TEXTURE_2D, mTexture, 0);
     QT_CHECK_GLERROR();
@@ -135,6 +133,13 @@ QWaylandPaintDevice::QWaylandPaintDevice(QWaylandDisplay *display, QWindowSurfac
     glGenFramebuffers(1, &m_thisFBO);
     glBindFramebuffer(GL_FRAMEBUFFER_EXT, m_thisFBO);
 
+    glGenRenderbuffers(1, &mDepthStencil);
+    glBindRenderbuffer(GL_RENDERBUFFER_EXT, mDepthStencil);
+    glFramebufferRenderbuffer(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT,
+                              GL_RENDERBUFFER_EXT, mDepthStencil);
+    glFramebufferRenderbuffer(GL_FRAMEBUFFER_EXT, GL_STENCIL_ATTACHMENT_EXT,
+                              GL_RENDERBUFFER_EXT, mDepthStencil);
+
     if (windowSurface->size().isValid())
         resize(windowSurface->size());
 }
@@ -184,15 +189,9 @@ void QWaylandPaintDevice::resize(const QSize &size)
         }
     }
 
-    glDeleteRenderbuffers(1,&mDepthStencil);
-    glGenRenderbuffers(1,&mDepthStencil);
     glBindRenderbuffer(GL_RENDERBUFFER_EXT,mDepthStencil);
     glRenderbufferStorage(GL_RENDERBUFFER_EXT,
                           GL_DEPTH24_STENCIL8_EXT, size.width(), size.height());
-    glFramebufferRenderbuffer(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT,
-                              GL_RENDERBUFFER_EXT, mDepthStencil);
-    glFramebufferRenderbuffer(GL_FRAMEBUFFER_EXT, GL_STENCIL_ATTACHMENT_EXT,
-                              GL_RENDERBUFFER_EXT, mDepthStencil);
 
     GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER_EXT);
 
@@ -247,6 +246,7 @@ void QWaylandDrmWindowSurface::flush(QWidget *widget, const QRegion &region, con
     Q_UNUSED(offset);
     QWaylandWindow *ww = (QWaylandWindow *) widget->platformWindow();
 
+    glFlush();
     ww->attach(mPaintDevice->currentDrmBufferAndSwap());
 
     QVector<QRect> rects = region.rects();
