diff options
author | Paul Olav Tvete <paul.tvete@qt.io> | 2016-11-10 12:48:57 +0100 |
---|---|---|
committer | Paul Olav Tvete <paul.tvete@qt.io> | 2016-11-10 12:50:29 +0100 |
commit | 7321747048a99626acbe054d34c3d364bfa73bcc (patch) | |
tree | 6f1905886dfed35dbba512b011bd39e18b1497ff /src/client | |
parent | 59965ed2277bb62e0ec38b149b570285828660fd (diff) | |
parent | c76a1716a3e51a9fac78377890ea0161a9658344 (diff) |
Merge remote-tracking branch 'qt/5.7' into 5.8
Change-Id: Ibfe6fe6ed983b537d55544883b7dc75e5cc3fc37
Diffstat (limited to 'src/client')
-rw-r--r-- | src/client/qwaylandclipboard.cpp | 10 | ||||
-rw-r--r-- | src/client/qwaylandclipboard_p.h | 5 | ||||
-rw-r--r-- | src/client/qwaylanddatadevice.cpp | 4 | ||||
-rw-r--r-- | src/client/qwaylanddatadevice_p.h | 4 | ||||
-rw-r--r-- | src/client/qwaylanddatadevicemanager.cpp | 4 | ||||
-rw-r--r-- | src/client/qwaylanddatadevicemanager_p.h | 4 | ||||
-rw-r--r-- | src/client/qwaylanddataoffer.cpp | 4 | ||||
-rw-r--r-- | src/client/qwaylanddataoffer_p.h | 3 | ||||
-rw-r--r-- | src/client/qwaylanddatasource.cpp | 4 | ||||
-rw-r--r-- | src/client/qwaylanddatasource_p.h | 4 | ||||
-rw-r--r-- | src/client/qwaylanddisplay.cpp | 6 | ||||
-rw-r--r-- | src/client/qwaylanddisplay_p.h | 6 | ||||
-rw-r--r-- | src/client/qwaylanddnd.cpp | 6 | ||||
-rw-r--r-- | src/client/qwaylanddnd_p.h | 4 | ||||
-rw-r--r-- | src/client/qwaylandinputdevice.cpp | 28 | ||||
-rw-r--r-- | src/client/qwaylandinputdevice_p.h | 4 | ||||
-rw-r--r-- | src/client/qwaylandintegration.cpp | 5 | ||||
-rw-r--r-- | src/client/qwaylandintegration_p.h | 7 | ||||
-rw-r--r-- | src/client/qwaylandnativeinterface.cpp | 2 | ||||
-rw-r--r-- | src/client/qwaylandnativeinterface_p.h | 3 | ||||
-rw-r--r-- | src/client/qwaylandwindow.cpp | 8 | ||||
-rw-r--r-- | src/client/qwaylandxdgsurface.cpp | 4 |
22 files changed, 110 insertions, 19 deletions
diff --git a/src/client/qwaylandclipboard.cpp b/src/client/qwaylandclipboard.cpp index 2e3c204c4..409abaa56 100644 --- a/src/client/qwaylandclipboard.cpp +++ b/src/client/qwaylandclipboard.cpp @@ -44,6 +44,8 @@ #include "qwaylanddatasource_p.h" #include "qwaylanddatadevice_p.h" +#ifndef QT_NO_DRAGANDDROP + QT_BEGIN_NAMESPACE namespace QtWaylandClient { @@ -60,11 +62,11 @@ QWaylandClipboard::~QWaylandClipboard() QMimeData *QWaylandClipboard::mimeData(QClipboard::Mode mode) { if (mode != QClipboard::Clipboard) - return 0; + return &m_emptyData; QWaylandInputDevice *inputDevice = mDisplay->currentInputDevice(); if (!inputDevice || !inputDevice->dataDevice()) - return 0; + return &m_emptyData; QWaylandDataSource *source = inputDevice->dataDevice()->selectionSource(); if (source) { @@ -74,7 +76,7 @@ QMimeData *QWaylandClipboard::mimeData(QClipboard::Mode mode) if (inputDevice->dataDevice()->selectionOffer()) return inputDevice->dataDevice()->selectionOffer()->mimeData(); - return 0; + return &m_emptyData; } void QWaylandClipboard::setMimeData(QMimeData *data, QClipboard::Mode mode) @@ -115,3 +117,5 @@ bool QWaylandClipboard::ownsMode(QClipboard::Mode mode) const } QT_END_NAMESPACE + +#endif // QT_NO_DRAGANDDROP diff --git a/src/client/qwaylandclipboard_p.h b/src/client/qwaylandclipboard_p.h index aa008eef9..646861342 100644 --- a/src/client/qwaylandclipboard_p.h +++ b/src/client/qwaylandclipboard_p.h @@ -53,9 +53,11 @@ #include <qpa/qplatformclipboard.h> #include <QtCore/QVariant> +#include <QtCore/QMimeData> #include <QtWaylandClient/qwaylandclientexport.h> +#ifndef QT_NO_DRAGANDDROP QT_BEGIN_NAMESPACE namespace QtWaylandClient { @@ -76,10 +78,13 @@ public: private: QWaylandDisplay *mDisplay; + QMimeData m_emptyData; }; } QT_END_NAMESPACE +#endif // QT_NO_DRAGANDDROP + #endif // QWAYLANDCLIPBOARD_H diff --git a/src/client/qwaylanddatadevice.cpp b/src/client/qwaylanddatadevice.cpp index d04c20bf4..f1a1ba6f0 100644 --- a/src/client/qwaylanddatadevice.cpp +++ b/src/client/qwaylanddatadevice.cpp @@ -56,6 +56,8 @@ #include <qpa/qplatformdrag.h> #include <qpa/qwindowsysteminterface.h> +#ifndef QT_NO_DRAGANDDROP + QT_BEGIN_NAMESPACE namespace QtWaylandClient { @@ -268,3 +270,5 @@ QPoint QWaylandDataDevice::calculateDragPosition(int x, int y, QWindow *wnd) con } QT_END_NAMESPACE + +#endif // QT_NO_DRAGANDDROP diff --git a/src/client/qwaylanddatadevice_p.h b/src/client/qwaylanddatadevice_p.h index 7daa9f0d3..318636de7 100644 --- a/src/client/qwaylanddatadevice_p.h +++ b/src/client/qwaylanddatadevice_p.h @@ -58,6 +58,8 @@ #include <QtWaylandClient/private/qwayland-wayland.h> +#ifndef QT_NO_DRAGANDDROP + QT_BEGIN_NAMESPACE class QMimeData; @@ -120,4 +122,6 @@ private: QT_END_NAMESPACE +#endif // QT_NO_DRAGANDDROP + #endif // QWAYLANDDATADEVICE_H diff --git a/src/client/qwaylanddatadevicemanager.cpp b/src/client/qwaylanddatadevicemanager.cpp index 35d67307f..5c6f74157 100644 --- a/src/client/qwaylanddatadevicemanager.cpp +++ b/src/client/qwaylanddatadevicemanager.cpp @@ -46,6 +46,8 @@ #include <QtCore/QDebug> +#ifndef QT_NO_DRAGANDDROP + QT_BEGIN_NAMESPACE namespace QtWaylandClient { @@ -80,3 +82,5 @@ QWaylandDisplay *QWaylandDataDeviceManager::display() const } QT_END_NAMESPACE + +#endif // QT_NO_DRAGANDDROP diff --git a/src/client/qwaylanddatadevicemanager_p.h b/src/client/qwaylanddatadevicemanager_p.h index 0c1d95d82..90ca301b3 100644 --- a/src/client/qwaylanddatadevicemanager_p.h +++ b/src/client/qwaylanddatadevicemanager_p.h @@ -54,6 +54,8 @@ #include <QtWaylandClient/qwaylandclientexport.h> #include <QtWaylandClient/private/qwayland-wayland.h> +#ifndef QT_NO_DRAGANDDROP + QT_BEGIN_NAMESPACE namespace QtWaylandClient { @@ -81,4 +83,6 @@ private: QT_END_NAMESPACE +#endif // QT_NO_DRAGANDDROP + #endif // QWAYLANDDATADEVICEMANAGER_H diff --git a/src/client/qwaylanddataoffer.cpp b/src/client/qwaylanddataoffer.cpp index 2491c658b..b33a98e0f 100644 --- a/src/client/qwaylanddataoffer.cpp +++ b/src/client/qwaylanddataoffer.cpp @@ -47,6 +47,8 @@ #include <QtCore/QDebug> +#ifndef QT_NO_DRAGANDDROP + QT_BEGIN_NAMESPACE namespace QtWaylandClient { @@ -181,3 +183,5 @@ int QWaylandMimeData::readData(int fd, QByteArray &data) const } QT_END_NAMESPACE + +#endif // QT_NO_DRAGANDDROP diff --git a/src/client/qwaylanddataoffer_p.h b/src/client/qwaylanddataoffer_p.h index 5e635c1a0..6368bff9b 100644 --- a/src/client/qwaylanddataoffer_p.h +++ b/src/client/qwaylanddataoffer_p.h @@ -56,6 +56,7 @@ #include <QtWaylandClient/qwaylandclientexport.h> #include <QtWaylandClient/private/qwayland-wayland.h> +#ifndef QT_NO_DRAGANDDROP QT_BEGIN_NAMESPACE namespace QtWaylandClient { @@ -105,5 +106,5 @@ private: } QT_END_NAMESPACE - +#endif // QT_NO_DRAGANDDROP #endif diff --git a/src/client/qwaylanddatasource.cpp b/src/client/qwaylanddatasource.cpp index 40beea317..bada694ca 100644 --- a/src/client/qwaylanddatasource.cpp +++ b/src/client/qwaylanddatasource.cpp @@ -49,6 +49,8 @@ #include <unistd.h> +#ifndef QT_NO_DRAGANDDROP + QT_BEGIN_NAMESPACE namespace QtWaylandClient { @@ -96,3 +98,5 @@ void QWaylandDataSource::data_source_target(const QString &mime_type) } QT_END_NAMESPACE + +#endif // QT_NO_DRAGANDDROP diff --git a/src/client/qwaylanddatasource_p.h b/src/client/qwaylanddatasource_p.h index c099ff62a..9e29ae8b8 100644 --- a/src/client/qwaylanddatasource_p.h +++ b/src/client/qwaylanddatasource_p.h @@ -56,6 +56,8 @@ #include <QtWaylandClient/private/qwayland-wayland.h> #include <QtWaylandClient/qwaylandclientexport.h> +#ifndef QT_NO_DRAGANDDROP + QT_BEGIN_NAMESPACE class QMimeData; @@ -92,4 +94,6 @@ private: QT_END_NAMESPACE +#endif // QT_NO_DRAGANDDROP + #endif // QWAYLANDDATASOURCE_H diff --git a/src/client/qwaylanddisplay.cpp b/src/client/qwaylanddisplay.cpp index 3fd2aa565..5f2c4e2ea 100644 --- a/src/client/qwaylanddisplay.cpp +++ b/src/client/qwaylanddisplay.cpp @@ -120,7 +120,9 @@ QWaylandWindowManagerIntegration *QWaylandDisplay::windowManagerIntegration() co QWaylandDisplay::QWaylandDisplay(QWaylandIntegration *waylandIntegration) : mWaylandIntegration(waylandIntegration) +#ifndef QT_NO_DRAGANDDROP , mDndSelectionHandler(0) +#endif , mWindowExtension(0) , mSubCompositor(0) , mTouchExtension(0) @@ -158,7 +160,9 @@ QWaylandDisplay::~QWaylandDisplay(void) mWaylandIntegration->destroyScreen(screen); } mScreens.clear(); +#ifndef QT_NO_DRAGANDDROP delete mDndSelectionHandler.take(); +#endif wl_display_disconnect(mDisplay); } @@ -251,8 +255,10 @@ void QWaylandDisplay::registry_global(uint32_t id, const QString &interface, uin } else if (interface == QStringLiteral("wl_seat")) { QWaylandInputDevice *inputDevice = mWaylandIntegration->createInputDevice(this, version, id); mInputDevices.append(inputDevice); +#ifndef QT_NO_DRAGANDDROP } else if (interface == QStringLiteral("wl_data_device_manager")) { mDndSelectionHandler.reset(new QWaylandDataDeviceManager(this, id)); +#endif } else if (interface == QStringLiteral("qt_surface_extension")) { mWindowExtension.reset(new QtWayland::qt_surface_extension(registry, id, 1)); } else if (interface == QStringLiteral("wl_subcompositor")) { diff --git a/src/client/qwaylanddisplay_p.h b/src/client/qwaylanddisplay_p.h index 2864b357d..fae17d535 100644 --- a/src/client/qwaylanddisplay_p.h +++ b/src/client/qwaylanddisplay_p.h @@ -137,9 +137,9 @@ public: QList<QWaylandInputDevice *> inputDevices() const { return mInputDevices; } QWaylandInputDevice *defaultInputDevice() const; QWaylandInputDevice *currentInputDevice() const { return defaultInputDevice(); } - +#ifndef QT_NO_DRAGANDDROP QWaylandDataDeviceManager *dndSelectionHandler() const { return mDndSelectionHandler.data(); } - +#endif QtWayland::qt_surface_extension *windowExtension() const { return mWindowExtension.data(); } QWaylandTouchExtension *touchExtension() const { return mTouchExtension.data(); } QtWayland::zwp_text_input_manager_v2 *textInputManager() const { return mTextInputManager.data(); } @@ -202,7 +202,9 @@ private: QList<QWaylandInputDevice *> mInputDevices; QList<Listener> mRegistryListeners; QWaylandIntegration *mWaylandIntegration; +#ifndef QT_NO_DRAGANDDROP QScopedPointer<QWaylandDataDeviceManager> mDndSelectionHandler; +#endif QScopedPointer<QtWayland::qt_surface_extension> mWindowExtension; QScopedPointer<QtWayland::wl_subcompositor> mSubCompositor; QScopedPointer<QWaylandTouchExtension> mTouchExtension; diff --git a/src/client/qwaylanddnd.cpp b/src/client/qwaylanddnd.cpp index b59ac6d70..e29267fc9 100644 --- a/src/client/qwaylanddnd.cpp +++ b/src/client/qwaylanddnd.cpp @@ -50,7 +50,7 @@ #include <QDebug> QT_BEGIN_NAMESPACE - +#ifndef QT_NO_DRAGANDDROP namespace QtWaylandClient { QWaylandDrag::QWaylandDrag(QWaylandDisplay *display) @@ -98,7 +98,7 @@ void QWaylandDrag::drop(const QPoint &globalPos) void QWaylandDrag::endDrag() { - // Do nothing + m_display->currentInputDevice()->handleEndDrag(); } void QWaylandDrag::updateTarget(const QString &mimeType) @@ -131,5 +131,5 @@ void QWaylandDrag::finishDrag(const QPlatformDropQtResponse &response) } } - +#endif // QT_NO_DRAGANDDROP QT_END_NAMESPACE diff --git a/src/client/qwaylanddnd_p.h b/src/client/qwaylanddnd_p.h index 2ff00b9ff..464b9837b 100644 --- a/src/client/qwaylanddnd_p.h +++ b/src/client/qwaylanddnd_p.h @@ -64,7 +64,7 @@ QT_BEGIN_NAMESPACE namespace QtWaylandClient { class QWaylandDisplay; - +#ifndef QT_NO_DRAGANDDROP class Q_WAYLAND_CLIENT_EXPORT QWaylandDrag : public QBasicDrag { public: @@ -88,7 +88,7 @@ protected: private: QWaylandDisplay *m_display; }; - +#endif } QT_END_NAMESPACE diff --git a/src/client/qwaylandinputdevice.cpp b/src/client/qwaylandinputdevice.cpp index f490f07ff..94316bafc 100644 --- a/src/client/qwaylandinputdevice.cpp +++ b/src/client/qwaylandinputdevice.cpp @@ -188,9 +188,11 @@ QWaylandInputDevice::QWaylandInputDevice(QWaylandDisplay *display, int version, , mSerial(0) , mTouchDevice(0) { +#ifndef QT_NO_DRAGANDDROP if (mQDisplay->dndSelectionHandler()) { mDataDevice = mQDisplay->dndSelectionHandler()->getDataDevice(this); } +#endif if (mQDisplay->textInputManager()) { mTextInput = new QWaylandTextInput(mQDisplay, mQDisplay->textInputManager()->get_text_input(wl_seat())); @@ -268,6 +270,14 @@ void QWaylandInputDevice::handleWindowDestroyed(QWaylandWindow *window) mTouch->mFocus = 0; } +void QWaylandInputDevice::handleEndDrag() +{ + if (mTouch) + mTouch->releasePoints(); + if (mPointer) + mPointer->releaseButtons(); +} + void QWaylandInputDevice::setDataDevice(QWaylandDataDevice *device) { mDataDevice = device; @@ -532,6 +542,14 @@ void QWaylandInputDevice::Pointer::pointer_button(uint32_t serial, uint32_t time } } +void QWaylandInputDevice::Pointer::releaseButtons() +{ + mButtons = Qt::NoButton; + MotionEvent e(mParent->mTime, mSurfacePos, mGlobalPos, mButtons, mParent->modifiers()); + if (mFocus) + mFocus->handleMouse(mParent, e); +} + class WheelEvent : public QWaylandPointerEvent { public: @@ -845,6 +863,16 @@ bool QWaylandInputDevice::Touch::allTouchPointsReleased() return true; } +void QWaylandInputDevice::Touch::releasePoints() +{ + Q_FOREACH (const QWindowSystemInterface::TouchPoint &previousPoint, mPrevTouchPoints) { + QWindowSystemInterface::TouchPoint tp = previousPoint; + tp.state = Qt::TouchPointReleased; + mTouchPoints.append(tp); + } + touch_frame(); +} + void QWaylandInputDevice::Touch::touch_frame() { // Copy all points, that are in the previous but not in the current list, as stationary. diff --git a/src/client/qwaylandinputdevice_p.h b/src/client/qwaylandinputdevice_p.h index ea685223d..2f39bc547 100644 --- a/src/client/qwaylandinputdevice_p.h +++ b/src/client/qwaylandinputdevice_p.h @@ -105,6 +105,7 @@ public: void setCursor(struct wl_buffer *buffer, const QPoint &hotSpot, const QSize &size); void setCursor(const QSharedPointer<QWaylandBuffer> &buffer, const QPoint &hotSpot); void handleWindowDestroyed(QWaylandWindow *window); + void handleEndDrag(); void setDataDevice(QWaylandDataDevice *device); QWaylandDataDevice *dataDevice() const; @@ -239,6 +240,8 @@ public: uint32_t axis, wl_fixed_t value) Q_DECL_OVERRIDE; + void releaseButtons(); + QWaylandInputDevice *mParent; QWaylandWindow *mFocus; uint32_t mEnterSerial; @@ -271,6 +274,7 @@ public: void touch_cancel() Q_DECL_OVERRIDE; bool allTouchPointsReleased(); + void releasePoints(); QWaylandInputDevice *mParent; QWaylandWindow *mFocus; diff --git a/src/client/qwaylandintegration.cpp b/src/client/qwaylandintegration.cpp index 3e2630610..32b4b8953 100644 --- a/src/client/qwaylandintegration.cpp +++ b/src/client/qwaylandintegration.cpp @@ -131,9 +131,10 @@ QWaylandIntegration::QWaylandIntegration() { initializeInputDeviceIntegration(); mDisplay.reset(new QWaylandDisplay(this)); +#ifndef QT_NO_DRAGANDDROP mClipboard.reset(new QWaylandClipboard(mDisplay.data())); mDrag.reset(new QWaylandDrag(mDisplay.data())); - +#endif QString icStr = QPlatformInputContextFactory::requested(); if (!icStr.isNull()) { mInputContext.reset(QPlatformInputContextFactory::create(icStr)); @@ -222,6 +223,7 @@ QPlatformFontDatabase *QWaylandIntegration::fontDatabase() const return mFontDb.data(); } +#ifndef QT_NO_DRAGANDDROP QPlatformClipboard *QWaylandIntegration::clipboard() const { return mClipboard.data(); @@ -231,6 +233,7 @@ QPlatformDrag *QWaylandIntegration::drag() const { return mDrag.data(); } +#endif // QT_NO_DRAGANDDROP QPlatformInputContext *QWaylandIntegration::inputContext() const { diff --git a/src/client/qwaylandintegration_p.h b/src/client/qwaylandintegration_p.h index bd66f55a7..3b91313b5 100644 --- a/src/client/qwaylandintegration_p.h +++ b/src/client/qwaylandintegration_p.h @@ -87,11 +87,10 @@ public: QPlatformFontDatabase *fontDatabase() const Q_DECL_OVERRIDE; QPlatformNativeInterface *nativeInterface() const Q_DECL_OVERRIDE; - +#ifndef QT_NO_DRAGANDDROP QPlatformClipboard *clipboard() const Q_DECL_OVERRIDE; - QPlatformDrag *drag() const Q_DECL_OVERRIDE; - +#endif QPlatformInputContext *inputContext() const Q_DECL_OVERRIDE; QVariant styleHint(StyleHint hint) const Q_DECL_OVERRIDE; @@ -128,8 +127,10 @@ private: QWaylandShellIntegration *createShellIntegration(const QString& interfaceName); QScopedPointer<QPlatformFontDatabase> mFontDb; +#ifndef QT_NO_DRAGANDDROP QScopedPointer<QPlatformClipboard> mClipboard; QScopedPointer<QPlatformDrag> mDrag; +#endif QScopedPointer<QWaylandDisplay> mDisplay; QScopedPointer<QPlatformNativeInterface> mNativeInterface; QScopedPointer<QPlatformInputContext> mInputContext; diff --git a/src/client/qwaylandnativeinterface.cpp b/src/client/qwaylandnativeinterface.cpp index 4a79fb5ab..52c61eec1 100644 --- a/src/client/qwaylandnativeinterface.cpp +++ b/src/client/qwaylandnativeinterface.cpp @@ -116,6 +116,7 @@ void *QWaylandNativeInterface::nativeResourceForScreen(const QByteArray &resourc return nullptr; } +#ifndef QT_NO_OPENGL void *QWaylandNativeInterface::nativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) { #ifdef QT_WAYLAND_GL_SUPPORT @@ -133,6 +134,7 @@ void *QWaylandNativeInterface::nativeResourceForContext(const QByteArray &resour return nullptr; } +#endif // QT_NO_OPENGL QVariantMap QWaylandNativeInterface::windowProperties(QPlatformWindow *window) const { diff --git a/src/client/qwaylandnativeinterface_p.h b/src/client/qwaylandnativeinterface_p.h index 83e3fe5fa..49e52cdcb 100644 --- a/src/client/qwaylandnativeinterface_p.h +++ b/src/client/qwaylandnativeinterface_p.h @@ -72,8 +72,9 @@ public: QWindow *window) Q_DECL_OVERRIDE; void *nativeResourceForScreen(const QByteArray &resourceString, QScreen *screen) Q_DECL_OVERRIDE; +#ifndef QT_NO_OPENGL void *nativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) Q_DECL_OVERRIDE; - +#endif QVariantMap windowProperties(QPlatformWindow *window) const Q_DECL_OVERRIDE; QVariant windowProperty(QPlatformWindow *window, const QString &name) const Q_DECL_OVERRIDE; QVariant windowProperty(QPlatformWindow *window, const QString &name, const QVariant &defaultValue) const Q_DECL_OVERRIDE; diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp index 2b7d81f88..6b9dde7c7 100644 --- a/src/client/qwaylandwindow.cpp +++ b/src/client/qwaylandwindow.cpp @@ -139,7 +139,7 @@ void QWaylandWindow::initWindow() if (mShellSurface) { // Set initial surface title - mShellSurface->setTitle(window()->title()); + setWindowTitle(window()->title()); // The appId is the desktop entry identifier that should follow the // reverse DNS convention (see http://standards.freedesktop.org/desktop-entry-spec/latest/ar01s02.html). @@ -261,7 +261,8 @@ void QWaylandWindow::setParent(const QPlatformWindow *parent) void QWaylandWindow::setWindowTitle(const QString &title) { if (mShellSurface) { - mShellSurface->setTitle(title); + const QString separator = QString::fromUtf8(" \xe2\x80\x94 "); // unicode character U+2014, EM DASH + mShellSurface->setTitle(formatWindowTitle(title, separator)); } if (mWindowDecoration && window()->isVisible()) @@ -285,6 +286,7 @@ void QWaylandWindow::setGeometry_helper(const QRect &rect) if (mSubSurfaceWindow) { QMargins m = QPlatformWindow::parent()->frameMargins(); mSubSurfaceWindow->set_position(rect.x() + m.left(), rect.y() + m.top()); + mSubSurfaceWindow->parent()->window()->requestUpdate(); } else if (shellSurface() && window()->transientParent() && window()->type() != Qt::Popup) shellSurface()->updateTransientParent(window()->transientParent()); } @@ -809,10 +811,12 @@ void QWaylandWindow::requestActivateWindow() void QWaylandWindow::unfocus() { +#ifndef QT_NO_DRAGANDDROP QWaylandInputDevice *inputDevice = mDisplay->currentInputDevice(); if (inputDevice && inputDevice->dataDevice()) { inputDevice->dataDevice()->invalidateSelectionOffer(); } +#endif } bool QWaylandWindow::isExposed() const diff --git a/src/client/qwaylandxdgsurface.cpp b/src/client/qwaylandxdgsurface.cpp index 4f9d8cfbf..a3bbb0648 100644 --- a/src/client/qwaylandxdgsurface.cpp +++ b/src/client/qwaylandxdgsurface.cpp @@ -138,7 +138,9 @@ void QWaylandXdgSurface::updateTransientParent(QWindow *parent) QWaylandWindow *parent_wayland_window = static_cast<QWaylandWindow *>(parent->handle()); if (!parent_wayland_window) return; - set_parent(m_shell->get_xdg_surface(parent_wayland_window->object())); + auto parentXdgSurface = qobject_cast<QWaylandXdgSurface *>(parent_wayland_window->shellSurface()); + Q_ASSERT(parentXdgSurface); + set_parent(parentXdgSurface->object()); } void QWaylandXdgSurface::setTitle(const QString & title) |