summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorGiulio Camuffo <giulio.camuffo@jollamobile.com>2014-09-06 00:26:20 +0300
committerGiulio Camuffo <giulio.camuffo@jollamobile.com>2014-09-08 14:06:08 +0200
commit929b4f03a67ec9577dcc9ed8981f69489b1e49a4 (patch)
tree057e5f9651fb491ece393f1703c53fa1c2273eb6 /tests/auto
parent374cb3b2872652317baec299712d7dfde6d9c896 (diff)
Fix QWaylandScreen geometry and physical size
The wl_output.geometry event carries the physical size of the output, not the logical one. This happened to work only because the geometry event was sent before the mode event, which carries the logical size. Moreover, use the done event to send only one geometry change event instead of one per advertized mode. Change-Id: I5b09d56654aac149d90692bb5a3e050cc0d60cb6 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/compositor/mockclient.cpp17
-rw-r--r--tests/auto/compositor/mockclient.h1
2 files changed, 13 insertions, 5 deletions
diff --git a/tests/auto/compositor/mockclient.cpp b/tests/auto/compositor/mockclient.cpp
index 2ee997ed5..9bbe56519 100644
--- a/tests/auto/compositor/mockclient.cpp
+++ b/tests/auto/compositor/mockclient.cpp
@@ -89,7 +89,8 @@ MockClient::MockClient()
const wl_output_listener MockClient::outputListener = {
MockClient::outputGeometryEvent,
- MockClient::outputModeEvent
+ MockClient::outputModeEvent,
+ MockClient::outputDone
};
MockClient::~MockClient()
@@ -103,12 +104,18 @@ void MockClient::outputGeometryEvent(void *data, wl_output *,
int, const char *, const char *,
int32_t )
{
- resolve(data)->geometry = QRect(x, y, width, height);
+ resolve(data)->geometry.moveTopLeft(QPoint(x, y));
}
-void MockClient::outputModeEvent(void *, wl_output *, uint32_t,
- int, int, int)
+void MockClient::outputModeEvent(void *data, wl_output *, uint32_t,
+ int w, int h, int)
{
+ resolve(data)->geometry.setSize(QSize(w, h));
+}
+
+void MockClient::outputDone(void *, wl_output *)
+{
+
}
void MockClient::readEvents()
@@ -132,7 +139,7 @@ void MockClient::handleGlobal(uint32_t id, const QByteArray &interface)
if (interface == "wl_compositor") {
compositor = static_cast<wl_compositor *>(wl_registry_bind(registry, id, &wl_compositor_interface, 1));
} else if (interface == "wl_output") {
- output = static_cast<wl_output *>(wl_registry_bind(registry, id, &wl_output_interface, 1));
+ output = static_cast<wl_output *>(wl_registry_bind(registry, id, &wl_output_interface, 2));
wl_output_add_listener(output, &outputListener, this);
} else if (interface == "wl_shm") {
shm = static_cast<wl_shm *>(wl_registry_bind(registry, id, &wl_shm_interface, 1));
diff --git a/tests/auto/compositor/mockclient.h b/tests/auto/compositor/mockclient.h
index 9f7c89d59..de1084ab9 100644
--- a/tests/auto/compositor/mockclient.h
+++ b/tests/auto/compositor/mockclient.h
@@ -103,6 +103,7 @@ private:
int width,
int height,
int refresh);
+ static void outputDone(void *data, wl_output *output);
void handleGlobal(uint32_t id, const QByteArray &interface);