diff options
author | Giulio Camuffo <giulio.camuffo@jollamobile.com> | 2014-03-31 17:18:43 +0300 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-04-29 11:17:45 +0200 |
commit | bb37532f36862eb29e033508d1c6c5dbc8c2be13 (patch) | |
tree | fa9d2e8300bf07f07e2c49b35e1bb936fbe8bc90 /src/compositor/wayland_wrapper/qwltouch.cpp | |
parent | 96ab8abe0b0faea7f63f0477025fe0649e410362 (diff) |
Split QWaylandSurface in a model and view fashion
QtQuick compositors already use a view class (QWaylandSurfaceItem),
so add a new QWaylandSurfaceView, which is subclassed by
QWaylandSurfaceItem, and move the view related methods of QWaylandSurface
there. A QWaylandSurface can have many views.
Change-Id: I7e92fe1f7e9d252f5f40a3097feabb5f3318b03a
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Diffstat (limited to 'src/compositor/wayland_wrapper/qwltouch.cpp')
-rw-r--r-- | src/compositor/wayland_wrapper/qwltouch.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/compositor/wayland_wrapper/qwltouch.cpp b/src/compositor/wayland_wrapper/qwltouch.cpp index d160bc4bf..8824cd09c 100644 --- a/src/compositor/wayland_wrapper/qwltouch.cpp +++ b/src/compositor/wayland_wrapper/qwltouch.cpp @@ -43,6 +43,7 @@ #include "qwlcompositor_p.h" #include "qwlsurface_p.h" +#include "qwaylandsurfaceview.h" namespace QtWayland { @@ -57,14 +58,14 @@ Touch::Touch(Compositor *compositor) connect(&m_focusDestroyListener, &WlListener::fired, this, &Touch::focusDestroyed); } -void Touch::setFocus(Surface *surface) +void Touch::setFocus(QWaylandSurfaceView *surface) { m_focusDestroyListener.reset(); if (surface) - m_focusDestroyListener.listenForDestruction(surface->resource()->handle); + m_focusDestroyListener.listenForDestruction(surface->surface()->handle()->resource()->handle); m_focus = surface; - m_focusResource = surface ? resourceMap().value(surface->resource()->client()) : 0; + m_focusResource = surface ? resourceMap().value(surface->surface()->handle()->resource()->client()) : 0; } void Touch::startGrab(TouchGrabber *grab) @@ -121,7 +122,7 @@ void Touch::down(uint32_t time, int touch_id, const QPointF &position) uint32_t serial = wl_display_next_serial(m_compositor->wl_display()); - send_down(m_focusResource->handle, serial, time, m_focus->resource()->handle, touch_id, + send_down(m_focusResource->handle, serial, time, m_focus->surface()->handle()->resource()->handle, touch_id, wl_fixed_from_double(position.x()), wl_fixed_from_double(position.y())); } |