diff options
author | Liang Qi <liang.qi@qt.io> | 2016-06-11 19:07:55 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2016-06-11 19:07:55 +0200 |
commit | 83f748ade15c0d85b87c6bde732d847cab826985 (patch) | |
tree | ea1cf4fc7f8f2070ca9a7059c437dad599b9e6c8 | |
parent | 3821f3bb85534a74b33689a48ec639616b65cb6b (diff) | |
parent | 06e8770129d5c49bfb518b02b3ece6d529e0e4c3 (diff) |
Merge remote-tracking branch 'origin/5.7' into dev
Conflicts:
src/compositor/wayland_wrapper/qwldatadevice.cpp
Change-Id: I2f555f969ec36b3e9b4123d758ae4176c5c90164
4 files changed, 19 insertions, 5 deletions
diff --git a/examples/wayland/qwindow-compositor/windowcompositor.cpp b/examples/wayland/qwindow-compositor/windowcompositor.cpp index 2ff5f75aa..ebbb5e470 100644 --- a/examples/wayland/qwindow-compositor/windowcompositor.cpp +++ b/examples/wayland/qwindow-compositor/windowcompositor.cpp @@ -291,6 +291,7 @@ void WindowCompositor::onXdgStartResize(QWaylandInputDevice *inputDevice, void WindowCompositor::onSetTransient(QWaylandSurface *parent, const QPoint &relativeToParent, QWaylandWlShellSurface::FocusPolicy focusPolicy) { + Q_UNUSED(focusPolicy); QWaylandWlShellSurface *wlShellSurface = qobject_cast<QWaylandWlShellSurface*>(sender()); WindowCompositorView *view = findView(wlShellSurface->surface()); diff --git a/src/compositor/compositor_api/qwaylandinputmethodcontrol.cpp b/src/compositor/compositor_api/qwaylandinputmethodcontrol.cpp index a82990f3d..122c589da 100644 --- a/src/compositor/compositor_api/qwaylandinputmethodcontrol.cpp +++ b/src/compositor/compositor_api/qwaylandinputmethodcontrol.cpp @@ -50,11 +50,14 @@ QWaylandInputMethodControl::QWaylandInputMethodControl(QWaylandSurface *surface) { connect(d_func()->compositor, &QWaylandCompositor::defaultInputDeviceChanged, this, &QWaylandInputMethodControl::defaultInputDeviceChanged); - connect(d_func()->textInput(), &QWaylandTextInput::surfaceEnabled, this, &QWaylandInputMethodControl::surfaceEnabled); - connect(d_func()->textInput(), &QWaylandTextInput::surfaceDisabled, this, &QWaylandInputMethodControl::surfaceDisabled); + QWaylandTextInput *textInput = d_func()->textInput(); + if (textInput) { + connect(textInput, &QWaylandTextInput::surfaceEnabled, this, &QWaylandInputMethodControl::surfaceEnabled); + connect(textInput, &QWaylandTextInput::surfaceDisabled, this, &QWaylandInputMethodControl::surfaceDisabled); #ifndef QT_NO_IM - connect(d_func()->textInput(), &QWaylandTextInput::updateInputMethod, this, &QWaylandInputMethodControl::updateInputMethod); + connect(textInput, &QWaylandTextInput::updateInputMethod, this, &QWaylandInputMethodControl::updateInputMethod); #endif + } } QVariant QWaylandInputMethodControl::inputMethodQuery(Qt::InputMethodQuery query, QVariant argument) const diff --git a/src/compositor/wayland_wrapper/qwldatadevice.cpp b/src/compositor/wayland_wrapper/qwldatadevice.cpp index 87b93f231..521e5dda5 100644 --- a/src/compositor/wayland_wrapper/qwldatadevice.cpp +++ b/src/compositor/wayland_wrapper/qwldatadevice.cpp @@ -155,6 +155,7 @@ void DataDevice::drop() m_dragDataSource->cancel(); } m_dragOrigin = nullptr; + setDragIcon(nullptr); } void DataDevice::cancelDrag() @@ -167,9 +168,8 @@ void DataDevice::data_device_start_drag(Resource *resource, struct ::wl_resource m_dragClient = resource->client(); m_dragDataSource = source ? DataSource::fromResource(source) : 0; m_dragOrigin = QWaylandSurface::fromResource(origin); - m_dragIcon = icon ? QWaylandSurface::fromResource(icon) : 0; QWaylandDrag *drag = m_inputDevice->drag(); - Q_EMIT drag->iconChanged(); + setDragIcon(icon ? QWaylandSurface::fromResource(icon) : nullptr); Q_EMIT drag->dragStarted(); Q_EMIT m_dragOrigin->dragStarted(drag); @@ -202,6 +202,14 @@ void DataDevice::data_device_set_selection(Resource *, struct ::wl_resource *sou } } +void DataDevice::setDragIcon(QWaylandSurface *icon) +{ + if (icon == m_dragIcon) + return; + m_dragIcon = icon; + Q_EMIT m_inputDevice->drag()->iconChanged(); +} + } QT_END_NAMESPACE diff --git a/src/compositor/wayland_wrapper/qwldatadevice_p.h b/src/compositor/wayland_wrapper/qwldatadevice_p.h index 62d6021f7..6a8e4e381 100644 --- a/src/compositor/wayland_wrapper/qwldatadevice_p.h +++ b/src/compositor/wayland_wrapper/qwldatadevice_p.h @@ -83,6 +83,8 @@ protected: void data_device_set_selection(Resource *resource, struct ::wl_resource *source, uint32_t serial) Q_DECL_OVERRIDE; private: + void setDragIcon(QWaylandSurface *icon); + QWaylandCompositor *m_compositor; QWaylandInputDevice *m_inputDevice; |