Update the wayland plugin
authorJørgen Lind <jorgen.lind@nokia.com>
Wed, 22 Jun 2011 08:00:28 +0000 (10:00 +0200)
committerQt by Nokia <qt-info@nokia.com>
Thu, 23 Jun 2011 15:03:51 +0000 (17:03 +0200)
to sha1 bfea3d6befdb688d5354e6f15a9400ea637febf9

Change-Id: Ie855cfbc6b786f1e738e205d403478614774ad34
Reviewed-on: http://codereview.qt.nokia.com/682
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
src/plugins/platforms/wayland/qwaylanddisplay.cpp
src/plugins/platforms/wayland/qwaylanddisplay.h
src/plugins/platforms/wayland/qwaylandwindow.cpp
src/plugins/platforms/wayland/wayland_sha1.txt

index e6d3968..93c98e3 100644 (file)
@@ -232,17 +232,36 @@ int QWaylandDisplay::sourceUpdate(uint32_t mask, void *data)
 }
 
 void QWaylandDisplay::outputHandleGeometry(void *data,
-                                           struct wl_output *output,
+                                           wl_output *output,
                                            int32_t x, int32_t y,
-                                           int32_t width, int32_t height)
+                                           int32_t physicalWidth,
+                                           int32_t physicalHeight,
+                                           int subpixel,
+                                           const char *make, const char *model)
 {
     QWaylandDisplay *waylandDisplay = static_cast<QWaylandDisplay *>(data);
-    QRect outputRect = QRect(x, y, width, height);
+    QRect outputRect = QRect(x, y, physicalWidth, physicalHeight);
     waylandDisplay->createNewScreen(output,outputRect);
 }
 
+void QWaylandDisplay::mode(void *data,
+             struct wl_output *wl_output,
+             uint32_t flags,
+             int width,
+             int height,
+             int refresh)
+{
+    Q_UNUSED(data);
+    Q_UNUSED(wl_output);
+    Q_UNUSED(flags);
+    Q_UNUSED(width);
+    Q_UNUSED(height);
+    Q_UNUSED(refresh);
+}
+
 const struct wl_output_listener QWaylandDisplay::outputListener = {
-    QWaylandDisplay::outputHandleGeometry
+    QWaylandDisplay::outputHandleGeometry,
+    QWaylandDisplay::mode
 };
 
 const struct wl_compositor_listener QWaylandDisplay::compositorListener = {
index ff8c760..87a3167 100644 (file)
@@ -132,7 +132,16 @@ private:
     static void outputHandleGeometry(void *data,
                                      struct wl_output *output,
                                      int32_t x, int32_t y,
-                                     int32_t width, int32_t height);
+                                     int32_t width, int32_t height,
+                                     int subpixel,
+                                     const char *make,
+                                     const char *model);
+    static void mode(void *data,
+                     struct wl_output *wl_output,
+                     uint32_t flags,
+                     int width,
+                     int height,
+                     int refresh);
 
     static void handleVisual(void *data,
                                        struct wl_compositor *compositor,
index eda8c94..3afe907 100644 (file)
@@ -58,6 +58,7 @@
 
 QWaylandWindow::QWaylandWindow(QWidget *window)
     : QPlatformWindow(window)
+    , mSurface(0)
     , mDisplay(QWaylandScreen::waylandScreenFromWidget(window)->display())
     , mBuffer(0)
     , mWaitingForFrameSync(false)
@@ -69,8 +70,6 @@ QWaylandWindow::QWaylandWindow(QWidget *window)
         mDisplay->windowManagerIntegration()->mapClientToProcess(qApp->applicationPid());
         mDisplay->windowManagerIntegration()->authenticateWithToken();
 #endif
-
-    mSurface = mDisplay->createSurface(this);
 }
 
 QWaylandWindow::~QWaylandWindow()
@@ -101,9 +100,7 @@ void QWaylandWindow::setVisible(bool visible)
         newSurfaceCreated();
     }
 
-    if (visible) {
-        wl_surface_map_toplevel(mSurface);
-    } else {
+    if (!visible) {
         wl_surface_destroy(mSurface);
         mSurface = NULL;
     }
@@ -143,6 +140,8 @@ void QWaylandWindow::damage(const QRegion &region)
         wl_buffer_damage(mBuffer->buffer(), rect.x(), rect.y(), rect.width(), rect.height());
         wl_surface_damage(mSurface,
                           rect.x(), rect.y(), rect.width(), rect.height());
+        wl_buffer_damage(mBuffer->buffer(),
+                         rect.x(), rect.y(), rect.width(), rect.height());
     }
 }
 
index d262437..a696e76 100644 (file)
@@ -1,3 +1,3 @@
 This version of the Qt Wayland plugin is checked against the following sha1
 from the Wayland repository:
-eff7fc0d99be2e51eaa351785030c8d374ac71de
+bfea3d6befdb688d5354e6f15a9400ea637febf9