summaryrefslogtreecommitdiffstats
path: root/src/compositor/wayland_wrapper
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.p.agocs@nokia.com>2012-01-14 14:58:35 +0200
committerJørgen Lind <jorgen.lind@nokia.com>2012-01-16 08:02:36 +0100
commitb4348fc574c93417010ef1b7a5d77166b9f75fa7 (patch)
tree2937eb1d534d1d68fb796dcce307bd7fe2999d87 /src/compositor/wayland_wrapper
parentc316a668cac0becfa651754ef1572d4122c2694a (diff)
Rename touch extension interface and fix event sending
Follow the naming convention of other extensions. The events are now posted only to the client to which the focus surface belongs, the check was previously missing. Change-Id: Ie43b6e887b64c7bed1377babb368129753a3cd0f Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
Diffstat (limited to 'src/compositor/wayland_wrapper')
-rw-r--r--src/compositor/wayland_wrapper/wltouch.cpp14
-rw-r--r--src/compositor/wayland_wrapper/wltouch.h2
2 files changed, 10 insertions, 6 deletions
diff --git a/src/compositor/wayland_wrapper/wltouch.cpp b/src/compositor/wayland_wrapper/wltouch.cpp
index b94d88cc4..b260bcb43 100644
--- a/src/compositor/wayland_wrapper/wltouch.cpp
+++ b/src/compositor/wayland_wrapper/wltouch.cpp
@@ -49,7 +49,7 @@ static void dummy(wl_client *, wl_resource *)
{
}
-const struct wl_touch_interface TouchExtensionGlobal::touch_interface = {
+const struct wl_touch_extension_interface TouchExtensionGlobal::touch_interface = {
dummy
};
@@ -57,7 +57,7 @@ TouchExtensionGlobal::TouchExtensionGlobal(Compositor *compositor)
: m_compositor(compositor)
{
wl_display_add_global(compositor->wl_display(),
- &wl_touch_interface,
+ &wl_touch_extension_interface,
this,
TouchExtensionGlobal::bind_func);
}
@@ -72,7 +72,7 @@ void TouchExtensionGlobal::destroy_resource(wl_resource *resource)
void TouchExtensionGlobal::bind_func(wl_client *client, void *data, uint32_t version, uint32_t id)
{
Q_UNUSED(version);
- wl_resource *resource = wl_client_add_object(client, &wl_touch_interface, &touch_interface, id, data);
+ wl_resource *resource = wl_client_add_object(client, &wl_touch_extension_interface, &touch_interface, id, data);
resource->destroy = destroy_resource;
TouchExtensionGlobal *self = static_cast<TouchExtensionGlobal *>(resource->data);
self->m_resources.append(resource);
@@ -91,10 +91,14 @@ void TouchExtensionGlobal::postTouchEvent(QTouchEvent *event, Surface *surface)
return;
QPointF surfacePos = surface->pos();
+ wl_client *surfaceClient = surface->base()->resource.client;
uint32_t time = m_compositor->currentTimeMsecs();
const int rescount = m_resources.count();
+
for (int res = 0; res < rescount; ++res) {
wl_resource *target = m_resources.at(res);
+ if (target->client != surfaceClient)
+ continue;
for (int i = 0; i < pointCount; ++i) {
const QTouchEvent::TouchPoint &tp(points.at(i));
@@ -112,14 +116,14 @@ void TouchExtensionGlobal::postTouchEvent(QTouchEvent *event, Surface *surface)
int vy = toFixed(tp.velocity().y());
uint32_t pressure = uint32_t(tp.pressure() * 255);
wl_array *rawData = 0;
- wl_resource_post_event(target, WL_TOUCH_TOUCH,
+ wl_resource_post_event(target, WL_TOUCH_EXTENSION_TOUCH,
time, id, state,
x, y, nx, ny, w, h,
pressure, vx, vy,
flags, rawData);
}
- wl_resource_post_event(target, WL_TOUCH_TOUCH_FRAME);
+ wl_resource_post_event(target, WL_TOUCH_EXTENSION_TOUCH_FRAME);
}
}
diff --git a/src/compositor/wayland_wrapper/wltouch.h b/src/compositor/wayland_wrapper/wltouch.h
index e52b7955c..fbd1cd0c1 100644
--- a/src/compositor/wayland_wrapper/wltouch.h
+++ b/src/compositor/wayland_wrapper/wltouch.h
@@ -65,7 +65,7 @@ private:
static void destroy_resource(wl_resource *resource);
- static const struct wl_touch_interface touch_interface;
+ static const struct wl_touch_extension_interface touch_interface;
QList<wl_resource *> m_resources;
};