tests: Implement wl_compositor v5
Change-Id: I60ff85d20b545ae97e3bbb49313ebedf1224a3ac Reviewed-by: David Edmundson <davidedmundson@kde.org>
This commit is contained in:
parent
7fdb0a1c4a
commit
5ecf0fcdf1
@ -77,8 +77,10 @@ void Surface::surface_attach(Resource *resource, wl_resource *buffer, int32_t x,
|
|||||||
m_image = QImage();
|
m_image = QImage();
|
||||||
} else {
|
} else {
|
||||||
QPoint offset(x, y);
|
QPoint offset(x, y);
|
||||||
|
if (resource->version() < 5)
|
||||||
|
m_pending.commitSpecific.attachOffset = offset;
|
||||||
|
|
||||||
m_pending.buffer = fromResource<Buffer>(buffer);
|
m_pending.buffer = fromResource<Buffer>(buffer);
|
||||||
m_pending.commitSpecific.attachOffset = offset;
|
|
||||||
m_pending.commitSpecific.attached = true;
|
m_pending.commitSpecific.attached = true;
|
||||||
|
|
||||||
emit attach(buffer, offset);
|
emit attach(buffer, offset);
|
||||||
@ -143,6 +145,13 @@ void Surface::surface_frame(Resource *resource, uint32_t callback)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Surface::surface_offset(Resource *resource, int32_t x, int32_t y)
|
||||||
|
{
|
||||||
|
Q_UNUSED(resource);
|
||||||
|
QPoint offset(x, y);
|
||||||
|
m_pending.commitSpecific.attachOffset = offset;
|
||||||
|
}
|
||||||
|
|
||||||
bool WlCompositor::isClean() {
|
bool WlCompositor::isClean() {
|
||||||
for (auto *surface : std::as_const(m_surfaces)) {
|
for (auto *surface : std::as_const(m_surfaces)) {
|
||||||
if (!CursorRole::fromSurface(surface)) {
|
if (!CursorRole::fromSurface(surface)) {
|
||||||
|
@ -124,6 +124,7 @@ protected:
|
|||||||
void surface_set_buffer_scale(Resource *resource, int32_t scale) override;
|
void surface_set_buffer_scale(Resource *resource, int32_t scale) override;
|
||||||
void surface_commit(Resource *resource) override;
|
void surface_commit(Resource *resource) override;
|
||||||
void surface_frame(Resource *resource, uint32_t callback) override;
|
void surface_frame(Resource *resource, uint32_t callback) override;
|
||||||
|
void surface_offset(Resource *resource, int32_t x, int32_t y) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
class Region : public QtWaylandServer::wl_region
|
class Region : public QtWaylandServer::wl_region
|
||||||
@ -145,7 +146,7 @@ class WlCompositor : public Global, public QtWaylandServer::wl_compositor
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit WlCompositor(CoreCompositor *compositor, int version = 4)
|
explicit WlCompositor(CoreCompositor *compositor, int version = 5)
|
||||||
: QtWaylandServer::wl_compositor(compositor->m_display, version)
|
: QtWaylandServer::wl_compositor(compositor->m_display, version)
|
||||||
, m_compositor(compositor)
|
, m_compositor(compositor)
|
||||||
{}
|
{}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user