summaryrefslogtreecommitdiffstats
path: root/src/compositor/compositor_api/qwaylandpointer.cpp
diff options
context:
space:
mode:
authorGiulio Camuffo <giulio.camuffo@kdab.com>2016-02-08 19:31:59 +0200
committerGiulio Camuffo <giuliocamuffo@gmail.com>2016-02-11 16:22:41 +0000
commit19d018dd6c7023dff7f7dcbaa7c38e486897495c (patch)
tree13614bfef93e529e73e02e355b7780833ef8cd03 /src/compositor/compositor_api/qwaylandpointer.cpp
parentb4f3f890475b50fac20c0d542a584dfdab4888a7 (diff)
Add surface roles back
Task-number: QTBUG-49809 Change-Id: Id62ddea68c89b6999b66d3df8eeeffd858ae844f Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
Diffstat (limited to 'src/compositor/compositor_api/qwaylandpointer.cpp')
-rw-r--r--src/compositor/compositor_api/qwaylandpointer.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/compositor/compositor_api/qwaylandpointer.cpp b/src/compositor/compositor_api/qwaylandpointer.cpp
index 550464544..a789c4c8c 100644
--- a/src/compositor/compositor_api/qwaylandpointer.cpp
+++ b/src/compositor/compositor_api/qwaylandpointer.cpp
@@ -41,6 +41,8 @@
QT_BEGIN_NAMESPACE
+QWaylandSurfaceRole QWaylandPointerPrivate::s_role("wl_pointer");
+
QWaylandPointerPrivate::QWaylandPointerPrivate(QWaylandPointer *pointer, QWaylandInputDevice *seat)
: QObjectPrivate()
, wl_pointer()
@@ -75,8 +77,18 @@ void QWaylandPointerPrivate::pointer_set_cursor(wl_pointer::Resource *resource,
}
QWaylandSurface *s = QWaylandSurface::fromResource(surface);
- s->markAsCursorSurface(true);
- seat->cursorSurfaceRequest(s, hotspot_x, hotspot_y);
+ // XXX FIXME
+ // The role concept was formalized in wayland 1.7, so that release adds one error
+ // code for each interface that implements a role, and we are supposed to pass here
+ // the newly constructed resource and the correct error code so that if setting the
+ // role fails, a proper error can be sent to the client.
+ // However we're still using wayland 1.4, which doesn't have interface specific role
+ // errors, so the best we can do is to use wl_display's object_id error.
+ 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);
+ }
}
/*!