diff options
author | Giulio Camuffo <giulio.camuffo@jollamobile.com> | 2014-09-06 00:26:20 +0300 |
---|---|---|
committer | Giulio Camuffo <giulio.camuffo@jollamobile.com> | 2014-09-08 14:06:08 +0200 |
commit | 929b4f03a67ec9577dcc9ed8981f69489b1e49a4 (patch) | |
tree | 057e5f9651fb491ece393f1703c53fa1c2273eb6 /tests | |
parent | 374cb3b2872652317baec299712d7dfde6d9c896 (diff) | |
download | qtwayland-929b4f03a67ec9577dcc9ed8981f69489b1e49a4.tar.gz |
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')
-rw-r--r-- | tests/auto/compositor/mockclient.cpp | 17 | ||||
-rw-r--r-- | tests/auto/compositor/mockclient.h | 1 |
2 files changed, 13 insertions, 5 deletions
diff --git a/tests/auto/compositor/mockclient.cpp b/tests/auto/compositor/mockclient.cpp index 2ee997ed..9bbe5651 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 9f7c89d5..de1084ab 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); |