summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Klokkhammer Helsing <johan.helsing@theqtcompany.com>2016-03-14 14:17:18 +0100
committerJohan Helsing <johan.helsing@theqtcompany.com>2016-03-15 13:32:07 +0000
commitbbc24ce7708b8b31313144d43e892f5838fcfafb (patch)
tree25633e97bf60d85ac83f6921d300e5bd1da7502c
parente197eab774c4d5416f96cb537d0c1d6637c8c2bc (diff)
qwindow-compositor: Fix cursor not being set for mapped surfaces
If a client sent a set_cursor request with a mapped surface, qwindow-compositor did not call updateCursor until the next time the surface was committed, which resulted in cursors with incorrect pixmaps and hotspots. This is solved by adding a check to see if the surface in set_cursor is already mapped, and if so, update the cursor immediately. The issue did not affect Qt clients, since commits are sent after set_cursor. Change-Id: I8b2555b68e9517e04f5bb8c5affe09d84bc97c0c Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com> Reviewed-by: Erik Larsson <erik@ortogonal.com> Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
-rw-r--r--examples/wayland/qwindow-compositor/windowcompositor.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/examples/wayland/qwindow-compositor/windowcompositor.cpp b/examples/wayland/qwindow-compositor/windowcompositor.cpp
index f592c64cd..fbb687172 100644
--- a/examples/wayland/qwindow-compositor/windowcompositor.cpp
+++ b/examples/wayland/qwindow-compositor/windowcompositor.cpp
@@ -255,6 +255,9 @@ void WindowCompositor::adjustCursorSurface(QWaylandSurface *surface, int hotspot
m_cursorView.setSurface(surface);
m_cursorHotspotX = hotspotX;
m_cursorHotspotY = hotspotY;
+
+ if (surface->isMapped())
+ updateCursor();
}
void WindowCompositor::closePopups()