diff options
author | Jørgen Lind <jorgen.lind@theqtcompany.com> | 2015-08-14 14:15:18 +0200 |
---|---|---|
committer | Jørgen Lind <jorgen.lind@theqtcompany.com> | 2015-08-28 13:10:33 +0200 |
commit | 463b9137b1b78def03fca6fc987df9bf249cb2f6 (patch) | |
tree | 3c958a367920e706f9bc118bcc98c6418c0d6c90 /src/compositor/wayland_wrapper/qwldatadevice.cpp | |
parent | bd6a5c4669801d7c86ffe2f8664dcfe0b4b7a906 (diff) |
Remove QtWayland::InputDevice
and add QWaylandInputDevicePrivate. Also make sure noone holds a
reference to the private instance.
Change-Id: Ic2327595d58d6308e1e2699370f53aef47061b04
Diffstat (limited to 'src/compositor/wayland_wrapper/qwldatadevice.cpp')
-rw-r--r-- | src/compositor/wayland_wrapper/qwldatadevice.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/compositor/wayland_wrapper/qwldatadevice.cpp b/src/compositor/wayland_wrapper/qwldatadevice.cpp index a7cb3bd9c..83d0b9dd3 100644 --- a/src/compositor/wayland_wrapper/qwldatadevice.cpp +++ b/src/compositor/wayland_wrapper/qwldatadevice.cpp @@ -38,7 +38,6 @@ #include "qwldatasource_p.h" #include "qwldataoffer_p.h" -#include "qwlinputdevice_p.h" #include "qwlkeyboard_p.h" #include "qwlpointer_p.h" #include "qwaylandsurface_p.h" @@ -49,6 +48,7 @@ #include "qwaylandview.h" #include <QtCompositor/QWaylandClient> #include <QtCompositor/private/qwaylandcompositor_p.h> +#include <QtCompositor/private/qwaylandinput_p.h> #include <QtCore/QPointF> #include <QDebug> @@ -146,7 +146,7 @@ void DataDevice::focus() void DataDevice::motion(uint32_t time) { - Q_EMIT QWaylandInputDevicePrivate::get(m_inputDevice)->dragHandle()->positionChanged(); + Q_EMIT m_inputDevice->drag()->positionChanged(); m_dragIconPosition = pointer->currentSpacePosition(); if (m_dragFocusResource && m_dragFocus) { @@ -171,8 +171,8 @@ void DataDevice::button(uint32_t time, Qt::MouseButton button, uint32_t state) if (m_dragIcon) { m_dragIcon = 0; m_dragIconPosition = QPointF(); - Q_EMIT QWaylandInputDevicePrivate::get(m_inputDevice)->dragHandle()->positionChanged(); - Q_EMIT QWaylandInputDevicePrivate::get(m_inputDevice)->dragHandle()->iconChanged(); + Q_EMIT m_inputDevice->drag()->positionChanged(); + Q_EMIT m_inputDevice->drag()->iconChanged(); } setDragFocus(0, QPointF()); @@ -182,8 +182,8 @@ void DataDevice::button(uint32_t time, Qt::MouseButton button, uint32_t state) void DataDevice::data_device_start_drag(Resource *resource, struct ::wl_resource *source, struct ::wl_resource *origin, struct ::wl_resource *icon, uint32_t serial) { - if (QWaylandInputDevicePrivate::get(m_inputDevice)->pointerDevice()->grabSerial() == serial) { - if (!QWaylandInputDevicePrivate::get(m_inputDevice)->pointerDevice()->isButtonPressed() || + if (m_inputDevice->pointer()->grabSerial() == serial) { + if (!m_inputDevice->pointer()->isButtonPressed() || m_inputDevice->mouseFocus()->surfaceResource() != origin) return; @@ -191,10 +191,10 @@ void DataDevice::data_device_start_drag(Resource *resource, struct ::wl_resource m_dragDataSource = source != 0 ? DataSource::fromResource(source) : 0; m_dragIcon = icon != 0 ? QWaylandSurface::fromResource(icon) : 0; m_dragIconPosition = QPointF(); - Q_EMIT QWaylandInputDevicePrivate::get(m_inputDevice)->dragHandle()->positionChanged(); - Q_EMIT QWaylandInputDevicePrivate::get(m_inputDevice)->dragHandle()->iconChanged(); + Q_EMIT m_inputDevice->drag()->positionChanged(); + Q_EMIT m_inputDevice->drag()->iconChanged(); - QWaylandInputDevicePrivate::get(m_inputDevice)->pointerDevice()->startGrab(this); + m_inputDevice->pointer()->startGrab(this); } } |