summaryrefslogtreecommitdiffstats
path: root/src/client
diff options
context:
space:
mode:
authorJohan Klokkhammer Helsing <johan.helsing@qt.io>2018-11-20 09:47:02 +0100
committerJohan Helsing <johan.helsing@qt.io>2018-11-21 12:20:58 +0000
commit91a94157d4245b7973ee117b7de5c44a10d3a457 (patch)
tree91f796460d6469724d220ab227e7180d361c1e71 /src/client
parent792057b7124bfc9a9aa0b1110693d6f868a1de58 (diff)
Client: Don't create cursor surface until we can set its role
We can't set the cursor role until we have gotten an enter event, so wait with creating the surface until we want to set the role for the first time. Makes testing easier since we don't have to deal with role-less surfaces that may or may not be the cursor surface. Change-Id: I99803d9b0b5933a271b6b1d56f74d4ff79813e40 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> Reviewed-by: David Edmundson <davidedmundson@kde.org>
Diffstat (limited to 'src/client')
-rw-r--r--src/client/qwaylandinputdevice.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/client/qwaylandinputdevice.cpp b/src/client/qwaylandinputdevice.cpp
index 5b5ad7a32..8f90a81a4 100644
--- a/src/client/qwaylandinputdevice.cpp
+++ b/src/client/qwaylandinputdevice.cpp
@@ -238,7 +238,6 @@ void QWaylandInputDevice::seat_capabilities(uint32_t caps)
if (caps & WL_SEAT_CAPABILITY_POINTER && !mPointer) {
mPointer = createPointer(this);
mPointer->init(get_pointer());
- pointerSurface = mQDisplay->createSurface(this);
} else if (!(caps & WL_SEAT_CAPABILITY_POINTER) && mPointer) {
delete mPointer;
mPointer = nullptr;
@@ -419,6 +418,9 @@ void QWaylandInputDevice::setCursor(struct wl_buffer *buffer, const QPoint &hotS
return;
}
+ if (!pointerSurface)
+ pointerSurface = mQDisplay->createSurface(this);
+
mPointer->set_cursor(mPointer->mEnterSerial, pointerSurface,
hotSpot.x(), hotSpot.y());
wl_surface_attach(pointerSurface, buffer, 0, 0);