summaryrefslogtreecommitdiffstats
path: root/src/compositor/compositor_api/qwaylandpointer.cpp
diff options
context:
space:
mode:
authorJaeyoon Jung <jaeyoon.jung@lge.com>2017-09-19 07:56:05 +0900
committerElvis Lee <kwangwoong.lee@lge.com>2021-02-22 17:07:14 +0900
commitbf60784393552a605d166330d3fdc87e900e8a0b (patch)
treee22c9e2b5ac8a00ba75cd4e8ebcf0f611b135da0 /src/compositor/compositor_api/qwaylandpointer.cpp
parentdcfb4ae6f9b2e2324fd2a8b6f1b20c5ae25f385b (diff)
Add client parameter for set_cursor
Identify the sender of set_cursor request to determine surfaces that the cursor surface is associated with. New signal cursorSurfaceRequested is added. And the old signal cursorSurfaceRequest is deprecated. A quote from the wayland protocol spec - "The cursor actually changes only if the pointer focus for this device is one of the requesting client's surfaces or the surface parameter is the current pointer surface." Pick-to: 6.1 Change-Id: I1cd1345d6479877925c200859868ae8717afd1fa Reviewed-by: Elvis Lee <kwangwoong.lee@lge.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Diffstat (limited to 'src/compositor/compositor_api/qwaylandpointer.cpp')
-rw-r--r--src/compositor/compositor_api/qwaylandpointer.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/compositor/compositor_api/qwaylandpointer.cpp b/src/compositor/compositor_api/qwaylandpointer.cpp
index 3a3ecde47..302e7cdd0 100644
--- a/src/compositor/compositor_api/qwaylandpointer.cpp
+++ b/src/compositor/compositor_api/qwaylandpointer.cpp
@@ -90,10 +90,10 @@ void QWaylandPointerPrivate::sendLeave()
uint32_t serial = compositor()->nextSerial();
for (auto resource : resourceMap().values(enteredSurface->waylandClient()))
send_leave(resource->handle, serial, enteredSurface->resource());
- enteredSurface = nullptr;
localPosition = QPointF();
enteredSurfaceDestroyListener.reset();
- seat->cursorSurfaceRequest(nullptr, 0, 0);
+ seat->cursorSurfaceRequested(nullptr, 0, 0, QWaylandClient::fromWlClient(compositor(), enteredSurface->waylandClient()));
+ enteredSurface = nullptr;
}
void QWaylandPointerPrivate::ensureEntered(QWaylandSurface *surface)
@@ -115,11 +115,10 @@ void QWaylandPointerPrivate::pointer_release(wl_pointer::Resource *resource)
void QWaylandPointerPrivate::pointer_set_cursor(wl_pointer::Resource *resource, uint32_t serial, wl_resource *surface, int32_t hotspot_x, int32_t hotspot_y)
{
- Q_UNUSED(resource);
Q_UNUSED(serial);
if (!surface) {
- seat->cursorSurfaceRequest(nullptr, 0, 0);
+ seat->cursorSurfaceRequested(nullptr, 0, 0, QWaylandClient::fromWlClient(compositor(), resource->client()));
return;
}
@@ -134,7 +133,7 @@ void QWaylandPointerPrivate::pointer_set_cursor(wl_pointer::Resource *resource,
wl_resource *displayRes = wl_client_get_object(resource->client(), 1);
if (s->setRole(&QWaylandPointerPrivate::s_role, displayRes, WL_DISPLAY_ERROR_INVALID_OBJECT)) {
s->markAsCursorSurface(true);
- seat->cursorSurfaceRequest(s, hotspot_x, hotspot_y);
+ seat->cursorSurfaceRequested(s, hotspot_x, hotspot_y, QWaylandClient::fromWlClient(compositor(), resource->client()));
}
}