Take cursor surface offset into account

From the spec

    On surface.attach requests to the pointer surface, hotspot_x
    and hotspot_y are decremented by the x and y parameters
    passed to the request. Attach must be confirmed by
    wl_surface.commit as usual.

In practice, I don't think it matters that much as most toolkits use
wl_pointer.set_cursor to change the hotspot.
This commit is contained in:
Vlad Zahorodnii 2023-05-09 20:53:51 +03:00
parent 1541e35362
commit 37aef0c015

View file

@ -124,6 +124,7 @@ KWaylandServer::SurfaceInterface *SurfaceCursorSource::surface() const
void SurfaceCursorSource::refresh()
{
m_size = m_surface->size();
m_hotspot -= m_surface->offset();
Q_EMIT changed();
}