wayland: Emit Cursor::changed signal when cursor surface is committed
The damaged signal is wired to the KWaylandServer::Cursor::changed signal to indicate when the cursor image changes, makes sense. But it can create issues if you repaint cursor SurfaceItem when the SurfaceInterface::damaged signal is emitted. There might be other signals that we need to wait for to invalidate SurfaceItem's state. The SurfaceInterface::committed is a better signal. When it's emitted, the surface commit has been completed. Technically, it's different from the damaged signal, but in practice they are equivalent. GTK and Qt always damage the cursor surface.
This commit is contained in:
parent
a9174ad9a0
commit
877406ba50
1 changed files with 2 additions and 2 deletions
|
@ -345,11 +345,11 @@ void CursorPrivate::update(SurfaceInterface *s, quint32 serial, const QPoint &p)
|
|||
}
|
||||
if (surface != s) {
|
||||
if (!surface.isNull()) {
|
||||
QObject::disconnect(surface.data(), &SurfaceInterface::damaged, q, &Cursor::changed);
|
||||
QObject::disconnect(surface.data(), &SurfaceInterface::committed, q, &Cursor::changed);
|
||||
}
|
||||
surface = s;
|
||||
if (!surface.isNull()) {
|
||||
QObject::connect(surface.data(), &SurfaceInterface::damaged, q, &Cursor::changed);
|
||||
QObject::connect(surface.data(), &SurfaceInterface::committed, q, &Cursor::changed);
|
||||
}
|
||||
emitChanged = true;
|
||||
Q_EMIT q->surfaceChanged();
|
||||
|
|
Loading…
Reference in a new issue