summaryrefslogtreecommitdiff
path: root/src/protocols/core/Seat.cpp
diff options
context:
space:
mode:
authorIkalco <73481042+ikalco@users.noreply.github.com>2025-08-29 15:16:40 -0500
committerGitHub <noreply@github.com>2025-08-29 22:16:40 +0200
commitea42041f936d5810c5cfa45d6bece12dde2fd9b6 (patch)
treed600f5a6a4fcdee8f3e24b666d1ea57ccc88cdd6 /src/protocols/core/Seat.cpp
parent05a1c0aa7395d19213e587c83089ecbd7b92085c (diff)
protocols: implement pointer-warp-v1 (#11469)
Diffstat (limited to 'src/protocols/core/Seat.cpp')
-rw-r--r--src/protocols/core/Seat.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/protocols/core/Seat.cpp b/src/protocols/core/Seat.cpp
index e89c49ae..0b356c6f 100644
--- a/src/protocols/core/Seat.cpp
+++ b/src/protocols/core/Seat.cpp
@@ -109,6 +109,8 @@ CWLPointerResource::CWLPointerResource(SP<CWlPointer> resource_, SP<CWLSeatResou
if UNLIKELY (!good())
return;
+ m_resource->setData(this);
+
m_resource->setRelease([this](CWlPointer* r) { PROTO::seat->destroyResource(this); });
m_resource->setOnDestroy([this](CWlPointer* r) { PROTO::seat->destroyResource(this); });
@@ -145,6 +147,11 @@ bool CWLPointerResource::good() {
return m_resource->resource();
}
+SP<CWLPointerResource> CWLPointerResource::fromResource(wl_resource* res) {
+ auto data = sc<CWLPointerResource*>(sc<CWlPointer*>(wl_resource_get_user_data(res))->data());
+ return data ? data->m_self.lock() : nullptr;
+}
+
void CWLPointerResource::sendEnter(SP<CWLSurfaceResource> surface, const Vector2D& local) {
if (!m_owner || m_currentSurface == surface || !surface->getResource()->resource())
return;
@@ -439,6 +446,8 @@ CWLSeatResource::CWLSeatResource(SP<CWlSeat> resource_) : m_resource(resource_)
return;
}
+ RESOURCE->m_self = RESOURCE;
+
m_pointers.emplace_back(RESOURCE);
});