From 477e7e844c10899f350e72b43c8a90621ba0f073 Mon Sep 17 00:00:00 2001 From: Giulio Camuffo Date: Mon, 30 May 2016 15:31:30 +0300 Subject: [PATCH 1/6] client: Always accept the DnD data offer Weston stopped sending the wl_data_device.drop event if the data offer was not accepted, which was the case when it was coming from the same client that was receiving the offer. So now always accept the offer even if we will bypass the offer when retrieving the data. Change-Id: If825f4dbc962a7812e379f36a42ceabe3eb3096f Reviewed-by: Johan Helsing Reviewed-by: Paul Olav Tvete --- .../platforms/wayland/qwaylanddatadevice.cpp | 34 +++++++++---------- 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/src/plugins/platforms/wayland/qwaylanddatadevice.cpp b/src/plugins/platforms/wayland/qwaylanddatadevice.cpp index 3276348e9be..d1c755e37e6 100644 --- a/src/plugins/platforms/wayland/qwaylanddatadevice.cpp +++ b/src/plugins/platforms/wayland/qwaylanddatadevice.cpp @@ -155,31 +155,29 @@ void QWaylandDataDevice::data_device_enter(uint32_t serial, wl_surface *surface, m_dragWindow = QWaylandWindow::fromWlSurface(surface)->window(); m_dragPoint = QPoint(wl_fixed_to_int(x), wl_fixed_to_int(y)); - QDrag *drag = static_cast(QGuiApplicationPrivate::platformIntegration()->drag())->currentDrag(); - QMimeData *dragData = Q_NULLPTR; Qt::DropActions supportedActions; + + m_dragOffer.reset(static_cast(wl_data_offer_get_user_data(id))); + QDrag *drag = static_cast(QGuiApplicationPrivate::platformIntegration()->drag())->currentDrag(); if (drag) { dragData = drag->mimeData(); supportedActions = drag->supportedActions(); - } else { - m_dragOffer.reset(static_cast(wl_data_offer_get_user_data(id))); - if (m_dragOffer) { - dragData = m_dragOffer->mimeData(); - supportedActions = Qt::CopyAction | Qt::MoveAction | Qt::LinkAction; - } + } else if (m_dragOffer) { + dragData = m_dragOffer->mimeData(); + supportedActions = Qt::CopyAction | Qt::MoveAction | Qt::LinkAction; } const QPlatformDragQtResponse &response = QWindowSystemInterface::handleDrag(m_dragWindow, dragData, m_dragPoint, supportedActions); if (drag) { static_cast(QGuiApplicationPrivate::platformIntegration()->drag())->setResponse(response); + } + + if (response.isAccepted()) { + wl_data_offer_accept(m_dragOffer->object(), m_enterSerial, m_dragOffer->firstFormat().toUtf8().constData()); } else { - if (response.isAccepted()) { - wl_data_offer_accept(m_dragOffer->object(), m_enterSerial, m_dragOffer->firstFormat().toUtf8().constData()); - } else { - wl_data_offer_accept(m_dragOffer->object(), m_enterSerial, 0); - } + wl_data_offer_accept(m_dragOffer->object(), m_enterSerial, 0); } } @@ -218,12 +216,12 @@ void QWaylandDataDevice::data_device_motion(uint32_t time, wl_fixed_t x, wl_fixe if (drag) { static_cast(QGuiApplicationPrivate::platformIntegration()->drag())->setResponse(response); + } + + if (response.isAccepted()) { + wl_data_offer_accept(m_dragOffer->object(), m_enterSerial, m_dragOffer->firstFormat().toUtf8().constData()); } else { - if (response.isAccepted()) { - wl_data_offer_accept(m_dragOffer->object(), m_enterSerial, m_dragOffer->firstFormat().toUtf8().constData()); - } else { - wl_data_offer_accept(m_dragOffer->object(), m_enterSerial, 0); - } + wl_data_offer_accept(m_dragOffer->object(), m_enterSerial, 0); } } From fe52b009f3ea03ef62c447fddcd8597bec1fc9a2 Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Wed, 8 Jun 2016 13:19:14 +0200 Subject: [PATCH 2/6] Set device pixel ratio for window decorations on scaled windows Change-Id: I40d96362131124effd9405cdad4e3dea79e6ebe3 Reviewed-by: Pier Luigi Fiorini --- src/plugins/platforms/wayland/qwaylandabstractdecoration.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/plugins/platforms/wayland/qwaylandabstractdecoration.cpp b/src/plugins/platforms/wayland/qwaylandabstractdecoration.cpp index 54a990b2d71..98e944365df 100644 --- a/src/plugins/platforms/wayland/qwaylandabstractdecoration.cpp +++ b/src/plugins/platforms/wayland/qwaylandabstractdecoration.cpp @@ -104,7 +104,10 @@ const QImage &QWaylandAbstractDecoration::contentImage() if (d->m_isDirty) { //Update the decoration backingstore - d->m_decorationContentImage = QImage(window()->frameGeometry().size(), QImage::Format_ARGB32_Premultiplied); + const int scale = waylandWindow()->scale(); + const QSize imageSize = window()->frameGeometry().size() * scale; + d->m_decorationContentImage = QImage(imageSize, QImage::Format_ARGB32_Premultiplied); + d->m_decorationContentImage.setDevicePixelRatio(scale); d->m_decorationContentImage.fill(Qt::transparent); this->paint(&d->m_decorationContentImage); From ad7245b942279c69c683aaeabf83f29c8b344962 Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Wed, 8 Jun 2016 17:40:25 +0200 Subject: [PATCH 3/6] Client: Fix incorrect size when maximizing using xdg_shell When maximizing xdg_shell clients, the clients would call QPlatformWindow::setGeometry() with frame margins included, resulting in a window that was bigger than what was requested by the compositor. The reason for this, was that QWaylandXdgSurface would subtract the frame margins from the width and height only when the resizing state was set, not when the maximized state was set. Later, margins were added again before QWaylandWindow::configure was called. This resulted in margins being subtracted and then added back for the resizing state, while for the maximized state margins were only added and never subtracted. This behavior has now been simplified so only size including window frame is tracked. This is what we receive in the XdgSurface::configure event anyway, and also what QWaylandWindow::configure expects. Change-Id: I0629e7e79a5367fa872743c6d025bfab8a4f2866 Reviewed-by: Giulio Camuffo --- .../platforms/wayland/qwaylandxdgsurface.cpp | 23 ++++++++----------- .../platforms/wayland/qwaylandxdgsurface_p.h | 2 +- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/src/plugins/platforms/wayland/qwaylandxdgsurface.cpp b/src/plugins/platforms/wayland/qwaylandxdgsurface.cpp index 202ac50bb67..8852d2dfb81 100644 --- a/src/plugins/platforms/wayland/qwaylandxdgsurface.cpp +++ b/src/plugins/platforms/wayland/qwaylandxdgsurface.cpp @@ -56,7 +56,6 @@ QWaylandXdgSurface::QWaylandXdgSurface(struct ::xdg_surface *xdg_surface, QWayla { if (window->display()->windowExtension()) m_extendedWindow = new QWaylandExtendedSurface(window); - m_size = m_window->window()->geometry().size(); } QWaylandXdgSurface::~QWaylandXdgSurface() @@ -187,10 +186,7 @@ void QWaylandXdgSurface::xdg_surface_configure(int32_t width, int32_t height, st aboutToFullScreen = true; break; case XDG_SURFACE_STATE_RESIZING: - m_margins = m_window->frameMargins(); - width -= m_margins.left() + m_margins.right(); - height -= m_margins.top() + m_margins.bottom(); - m_size = m_window->window()->geometry().size(); + m_normalSize = QSize(width, height); break; case XDG_SURFACE_STATE_ACTIVATED: // TODO: here about the missing window activation @@ -201,6 +197,8 @@ void QWaylandXdgSurface::xdg_surface_configure(int32_t width, int32_t height, st } if (!m_fullscreen && aboutToFullScreen) { + if (!m_maximized) + m_normalSize = m_window->window()->frameGeometry().size(); m_fullscreen = true; m_window->window()->showFullScreen(); } else if (m_fullscreen && !aboutToFullScreen) { @@ -211,6 +209,8 @@ void QWaylandXdgSurface::xdg_surface_configure(int32_t width, int32_t height, st m_window->window()->showNormal(); } } else if (!m_maximized && aboutToMaximize) { + if (!m_fullscreen) + m_normalSize = m_window->window()->frameGeometry().size(); m_maximized = true; m_window->window()->showMaximized(); } else if (m_maximized && !aboutToMaximize) { @@ -218,14 +218,11 @@ void QWaylandXdgSurface::xdg_surface_configure(int32_t width, int32_t height, st m_window->window()->showNormal(); } - if (width == 0 || height == 0) { - width = m_size.width(); - height = m_size.height(); - } - - if (width > 0 && height > 0) { - m_margins = m_window->frameMargins(); - m_window->configure(0, width + m_margins.left() + m_margins.right(), height + m_margins.top() + m_margins.bottom()); + if (width <= 0 || height <= 0) { + if (!m_normalSize.isEmpty()) + m_window->configure(0, m_normalSize.width(), m_normalSize.height()); + } else { + m_window->configure(0, width, height); } ack_configure(serial); diff --git a/src/plugins/platforms/wayland/qwaylandxdgsurface_p.h b/src/plugins/platforms/wayland/qwaylandxdgsurface_p.h index 8deafef7756..d4380d25fbb 100644 --- a/src/plugins/platforms/wayland/qwaylandxdgsurface_p.h +++ b/src/plugins/platforms/wayland/qwaylandxdgsurface_p.h @@ -106,7 +106,7 @@ private: bool m_maximized; bool m_minimized; bool m_fullscreen; - QSize m_size; + QSize m_normalSize; QMargins m_margins; QWaylandExtendedSurface *m_extendedWindow; From e8d77c010107c3a5c378f703b17691c77d29e2d6 Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Thu, 9 Jun 2016 11:59:06 +0200 Subject: [PATCH 4/6] Only resize when the cursor is actually on the window frame The previous code seems to have been written under the impression that QWindow::width() included frame margins, causing the resizing areas of the window decoration to be too large. Change-Id: Ia13f12afd88a4017d01853798226455b84290d01 Reviewed-by: Giulio Camuffo --- .../wayland/plugins/decorations/bradient/main.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/platforms/wayland/plugins/decorations/bradient/main.cpp b/src/plugins/platforms/wayland/plugins/decorations/bradient/main.cpp index ea298699385..3dd5c8b699a 100644 --- a/src/plugins/platforms/wayland/plugins/decorations/bradient/main.cpp +++ b/src/plugins/platforms/wayland/plugins/decorations/bradient/main.cpp @@ -359,11 +359,11 @@ bool QWaylandBradientDecoration::handleMouse(QWaylandInputDevice *inputDevice, c window()->setWindowState(Qt::WindowMinimized); } else if (local.y() <= margins().top()) { processMouseTop(inputDevice,local,b,mods); - } else if (local.y() > window()->height() - margins().bottom() + margins().top()) { + } else if (local.y() > window()->height() + margins().top()) { processMouseBottom(inputDevice,local,b,mods); } else if (local.x() <= margins().left()) { processMouseLeft(inputDevice,local,b,mods); - } else if (local.x() > window()->width() - margins().right() + margins().left()) { + } else if (local.x() > window()->width() + margins().left()) { processMouseRight(inputDevice,local,b,mods); } else { waylandWindow()->restoreMouseCursor(inputDevice); @@ -405,7 +405,7 @@ void QWaylandBradientDecoration::processMouseTop(QWaylandInputDevice *inputDevic //top left bit waylandWindow()->setMouseCursor(inputDevice, Qt::SizeFDiagCursor); startResize(inputDevice,WL_SHELL_SURFACE_RESIZE_TOP_LEFT,b); - } else if (local.x() > window()->width() - margins().right()) { + } else if (local.x() > window()->width() + margins().left()) { //top right bit waylandWindow()->setMouseCursor(inputDevice, Qt::SizeBDiagCursor); startResize(inputDevice,WL_SHELL_SURFACE_RESIZE_TOP_RIGHT,b); @@ -428,7 +428,7 @@ void QWaylandBradientDecoration::processMouseBottom(QWaylandInputDevice *inputDe //bottom left bit waylandWindow()->setMouseCursor(inputDevice, Qt::SizeBDiagCursor); startResize(inputDevice, WL_SHELL_SURFACE_RESIZE_BOTTOM_LEFT,b); - } else if (local.x() > window()->width() - margins().right()) { + } else if (local.x() > window()->width() + margins().left()) { //bottom right bit waylandWindow()->setMouseCursor(inputDevice, Qt::SizeFDiagCursor); startResize(inputDevice, WL_SHELL_SURFACE_RESIZE_BOTTOM_RIGHT,b); From 795378e64c006121a772f3c8597d7c3d02bcc965 Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Thu, 23 Jun 2016 09:54:18 +0200 Subject: [PATCH 5/6] Add missing Q_DECL_OVERRIDEs to client classes. Change-Id: I10e550a25ce498bbeedc242ac73059cc6fdcef30 Reviewed-by: Pier Luigi Fiorini Reviewed-by: Giulio Camuffo --- .../qwaylandhardwareintegration_p.h | 4 +-- .../libhybris-egl-server/main.cpp | 2 +- .../platforms/wayland/qwaylandcursor_p.h | 8 ++--- .../wayland/qwaylandinputcontext_p.h | 2 +- .../platforms/wayland/qwaylandinputdevice_p.h | 2 +- .../platforms/wayland/qwaylandintegration_p.h | 32 +++++++++---------- .../wayland/qwaylandnativeinterface_p.h | 16 +++++----- .../platforms/wayland/qwaylandscreen_p.h | 16 +++++----- .../wayland/qwaylandshmbackingstore_p.h | 10 +++--- .../platforms/wayland/qwaylandshmwindow_p.h | 4 +-- .../platforms/wayland/qwaylandwindow_p.h | 22 ++++++------- .../qwaylandwindowmanagerintegration_p.h | 6 ++-- 12 files changed, 62 insertions(+), 62 deletions(-) diff --git a/src/plugins/platforms/wayland/hardwareintegration/qwaylandhardwareintegration_p.h b/src/plugins/platforms/wayland/hardwareintegration/qwaylandhardwareintegration_p.h index 466f0b20bbb..7ec7479790b 100644 --- a/src/plugins/platforms/wayland/hardwareintegration/qwaylandhardwareintegration_p.h +++ b/src/plugins/platforms/wayland/hardwareintegration/qwaylandhardwareintegration_p.h @@ -63,8 +63,8 @@ public: QString serverBufferIntegration(); protected: - void hardware_integration_client_backend(const QString &name); - void hardware_integration_server_backend(const QString &name); + void hardware_integration_client_backend(const QString &name) Q_DECL_OVERRIDE; + void hardware_integration_server_backend(const QString &name) Q_DECL_OVERRIDE; private: QString m_client_buffer; diff --git a/src/plugins/platforms/wayland/plugins/hardwareintegration/libhybris-egl-server/main.cpp b/src/plugins/platforms/wayland/plugins/hardwareintegration/libhybris-egl-server/main.cpp index e51c4bfb5cd..ad7eac7a68c 100644 --- a/src/plugins/platforms/wayland/plugins/hardwareintegration/libhybris-egl-server/main.cpp +++ b/src/plugins/platforms/wayland/plugins/hardwareintegration/libhybris-egl-server/main.cpp @@ -43,7 +43,7 @@ class LibHybrisEglServerBufferPlugin : public QWaylandServerBufferIntegrationPlu Q_OBJECT Q_PLUGIN_METADATA(IID QWaylandServerBufferIntegrationFactoryInterface_iid FILE "libhybris-egl-server.json") public: - QWaylandServerBufferIntegration *create(const QString&, const QStringList&); + QWaylandServerBufferIntegration *create(const QString&, const QStringList&) Q_DECL_OVERRIDE; }; QWaylandServerBufferIntegration *LibHybrisEglServerBufferPlugin::create(const QString& system, const QStringList& paramList) diff --git a/src/plugins/platforms/wayland/qwaylandcursor_p.h b/src/plugins/platforms/wayland/qwaylandcursor_p.h index 9e06cf6265b..a3461441ca7 100644 --- a/src/plugins/platforms/wayland/qwaylandcursor_p.h +++ b/src/plugins/platforms/wayland/qwaylandcursor_p.h @@ -67,10 +67,10 @@ public: QWaylandCursor(QWaylandScreen *screen); ~QWaylandCursor(); - void changeCursor(QCursor *cursor, QWindow *window); - void pointerEvent(const QMouseEvent &event); - QPoint pos() const; - void setPos(const QPoint &pos); + void changeCursor(QCursor *cursor, QWindow *window) Q_DECL_OVERRIDE; + void pointerEvent(const QMouseEvent &event) Q_DECL_OVERRIDE; + QPoint pos() const Q_DECL_OVERRIDE; + void setPos(const QPoint &pos) Q_DECL_OVERRIDE; struct wl_cursor_image *cursorImage(Qt::CursorShape shape); QSharedPointer cursorBitmapImage(const QCursor *cursor); diff --git a/src/plugins/platforms/wayland/qwaylandinputcontext_p.h b/src/plugins/platforms/wayland/qwaylandinputcontext_p.h index 679baa497c7..f6ade8db7f1 100644 --- a/src/plugins/platforms/wayland/qwaylandinputcontext_p.h +++ b/src/plugins/platforms/wayland/qwaylandinputcontext_p.h @@ -77,7 +77,7 @@ protected: void text_input_commit_string(uint32_t serial, const QString &text) Q_DECL_OVERRIDE; void text_input_enter(wl_surface *surface) Q_DECL_OVERRIDE; void text_input_leave() Q_DECL_OVERRIDE; - void text_input_keysym(uint32_t serial, uint32_t time, uint32_t sym, uint32_t state, uint32_t modifiers); + void text_input_keysym(uint32_t serial, uint32_t time, uint32_t sym, uint32_t state, uint32_t modifiers) Q_DECL_OVERRIDE; private: QString m_commit; diff --git a/src/plugins/platforms/wayland/qwaylandinputdevice_p.h b/src/plugins/platforms/wayland/qwaylandinputdevice_p.h index 508b67078d9..1df90292b50 100644 --- a/src/plugins/platforms/wayland/qwaylandinputdevice_p.h +++ b/src/plugins/platforms/wayland/qwaylandinputdevice_p.h @@ -222,7 +222,7 @@ public: void pointer_enter(uint32_t serial, struct wl_surface *surface, wl_fixed_t sx, wl_fixed_t sy) Q_DECL_OVERRIDE; - void pointer_leave(uint32_t time, struct wl_surface *surface); + void pointer_leave(uint32_t time, struct wl_surface *surface) Q_DECL_OVERRIDE; void pointer_motion(uint32_t time, wl_fixed_t sx, wl_fixed_t sy) Q_DECL_OVERRIDE; void pointer_button(uint32_t serial, uint32_t time, diff --git a/src/plugins/platforms/wayland/qwaylandintegration_p.h b/src/plugins/platforms/wayland/qwaylandintegration_p.h index 42bc287b5ad..987d80599f8 100644 --- a/src/plugins/platforms/wayland/qwaylandintegration_p.h +++ b/src/plugins/platforms/wayland/qwaylandintegration_p.h @@ -66,37 +66,37 @@ public: QWaylandIntegration(); ~QWaylandIntegration(); - bool hasCapability(QPlatformIntegration::Capability cap) const; - QPlatformWindow *createPlatformWindow(QWindow *window) const; + bool hasCapability(QPlatformIntegration::Capability cap) const Q_DECL_OVERRIDE; + QPlatformWindow *createPlatformWindow(QWindow *window) const Q_DECL_OVERRIDE; #ifndef QT_NO_OPENGL - QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const; + QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const Q_DECL_OVERRIDE; #endif - QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const; + QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const Q_DECL_OVERRIDE; - QAbstractEventDispatcher *createEventDispatcher() const; - void initialize(); + QAbstractEventDispatcher *createEventDispatcher() const Q_DECL_OVERRIDE; + void initialize() Q_DECL_OVERRIDE; - QPlatformFontDatabase *fontDatabase() const; + QPlatformFontDatabase *fontDatabase() const Q_DECL_OVERRIDE; - QPlatformNativeInterface *nativeInterface() const; + QPlatformNativeInterface *nativeInterface() const Q_DECL_OVERRIDE; - QPlatformClipboard *clipboard() const; + QPlatformClipboard *clipboard() const Q_DECL_OVERRIDE; - QPlatformDrag *drag() const; + QPlatformDrag *drag() const Q_DECL_OVERRIDE; - QPlatformInputContext *inputContext() const; + QPlatformInputContext *inputContext() const Q_DECL_OVERRIDE; - QVariant styleHint(StyleHint hint) const; + QVariant styleHint(StyleHint hint) const Q_DECL_OVERRIDE; - QPlatformAccessibility *accessibility() const; + QPlatformAccessibility *accessibility() const Q_DECL_OVERRIDE; - QPlatformServices *services() const; + QPlatformServices *services() const Q_DECL_OVERRIDE; QWaylandDisplay *display() const; - QStringList themeNames() const; + QStringList themeNames() const Q_DECL_OVERRIDE; - QPlatformTheme *createPlatformTheme(const QString &name) const; + QPlatformTheme *createPlatformTheme(const QString &name) const Q_DECL_OVERRIDE; QWaylandInputDevice *createInputDevice(QWaylandDisplay *display, int version, uint32_t id); diff --git a/src/plugins/platforms/wayland/qwaylandnativeinterface_p.h b/src/plugins/platforms/wayland/qwaylandnativeinterface_p.h index 7050f975885..b4cb8fcb4e1 100644 --- a/src/plugins/platforms/wayland/qwaylandnativeinterface_p.h +++ b/src/plugins/platforms/wayland/qwaylandnativeinterface_p.h @@ -61,17 +61,17 @@ class Q_WAYLAND_CLIENT_EXPORT QWaylandNativeInterface : public QPlatformNativeIn { public: QWaylandNativeInterface(QWaylandIntegration *integration); - void *nativeResourceForIntegration(const QByteArray &resource); + void *nativeResourceForIntegration(const QByteArray &resource) Q_DECL_OVERRIDE; void *nativeResourceForWindow(const QByteArray &resourceString, - QWindow *window); + QWindow *window) Q_DECL_OVERRIDE; void *nativeResourceForScreen(const QByteArray &resourceString, - QScreen *screen); - void *nativeResourceForContext(const QByteArray &resource, QOpenGLContext *context); + QScreen *screen) Q_DECL_OVERRIDE; + void *nativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) Q_DECL_OVERRIDE; - QVariantMap windowProperties(QPlatformWindow *window) const; - QVariant windowProperty(QPlatformWindow *window, const QString &name) const; - QVariant windowProperty(QPlatformWindow *window, const QString &name, const QVariant &defaultValue) const; - void setWindowProperty(QPlatformWindow *window, const QString &name, const QVariant &value); + 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; + void setWindowProperty(QPlatformWindow *window, const QString &name, const QVariant &value) Q_DECL_OVERRIDE; void emitWindowPropertyChanged(QPlatformWindow *window, const QString &name); diff --git a/src/plugins/platforms/wayland/qwaylandscreen_p.h b/src/plugins/platforms/wayland/qwaylandscreen_p.h index e3e1515d4fa..5cc11e8c5b5 100644 --- a/src/plugins/platforms/wayland/qwaylandscreen_p.h +++ b/src/plugins/platforms/wayland/qwaylandscreen_p.h @@ -66,25 +66,25 @@ public: void init(); QWaylandDisplay *display() const; - QRect geometry() const; - int depth() const; - QImage::Format format() const; + QRect geometry() const Q_DECL_OVERRIDE; + int depth() const Q_DECL_OVERRIDE; + QImage::Format format() const Q_DECL_OVERRIDE; QSizeF physicalSize() const Q_DECL_OVERRIDE; QDpi logicalDpi() const Q_DECL_OVERRIDE; QList virtualSiblings() const Q_DECL_OVERRIDE; - void setOrientationUpdateMask(Qt::ScreenOrientations mask); + void setOrientationUpdateMask(Qt::ScreenOrientations mask) Q_DECL_OVERRIDE; - Qt::ScreenOrientation orientation() const; + Qt::ScreenOrientation orientation() const Q_DECL_OVERRIDE; int scale() const; qreal devicePixelRatio() const Q_DECL_OVERRIDE; - qreal refreshRate() const; + qreal refreshRate() const Q_DECL_OVERRIDE; - QString name() const { return mOutputName; } + QString name() const Q_DECL_OVERRIDE { return mOutputName; } - QPlatformCursor *cursor() const; + QPlatformCursor *cursor() const Q_DECL_OVERRIDE; QWaylandCursor *waylandCursor() const { return mWaylandCursor; }; uint32_t outputId() const { return m_outputId; } diff --git a/src/plugins/platforms/wayland/qwaylandshmbackingstore_p.h b/src/plugins/platforms/wayland/qwaylandshmbackingstore_p.h index 8b58c0b5eda..8ad559187b9 100644 --- a/src/plugins/platforms/wayland/qwaylandshmbackingstore_p.h +++ b/src/plugins/platforms/wayland/qwaylandshmbackingstore_p.h @@ -66,7 +66,7 @@ public: QWaylandShmBuffer(QWaylandDisplay *display, const QSize &size, QImage::Format format, int scale = 1); ~QWaylandShmBuffer(); - QSize size() const { return mImage.size(); } + QSize size() const Q_DECL_OVERRIDE { return mImage.size(); } int scale() const Q_DECL_OVERRIDE { return int(mImage.devicePixelRatio()); } QImage *image() { return &mImage; } @@ -85,11 +85,11 @@ public: ~QWaylandShmBackingStore(); QPaintDevice *paintDevice(); - void flush(QWindow *window, const QRegion ®ion, const QPoint &offset); - void resize(const QSize &size, const QRegion &staticContents); + void flush(QWindow *window, const QRegion ®ion, const QPoint &offset) Q_DECL_OVERRIDE; + void resize(const QSize &size, const QRegion &staticContents) Q_DECL_OVERRIDE; void resize(const QSize &size); - void beginPaint(const QRegion &); - void endPaint(); + void beginPaint(const QRegion &) Q_DECL_OVERRIDE; + void endPaint() Q_DECL_OVERRIDE; void hidden(); QWaylandAbstractDecoration *windowDecoration() const; diff --git a/src/plugins/platforms/wayland/qwaylandshmwindow_p.h b/src/plugins/platforms/wayland/qwaylandshmwindow_p.h index a0a5edffd4a..ea903980d20 100644 --- a/src/plugins/platforms/wayland/qwaylandshmwindow_p.h +++ b/src/plugins/platforms/wayland/qwaylandshmwindow_p.h @@ -58,8 +58,8 @@ public: QWaylandShmWindow(QWindow *window); ~QWaylandShmWindow(); - WindowType windowType() const; - QSurfaceFormat format() const { return QSurfaceFormat(); } + WindowType windowType() const Q_DECL_OVERRIDE; + QSurfaceFormat format() const Q_DECL_OVERRIDE { return QSurfaceFormat(); } }; } diff --git a/src/plugins/platforms/wayland/qwaylandwindow_p.h b/src/plugins/platforms/wayland/qwaylandwindow_p.h index 6e271cc1066..c60891d49f0 100644 --- a/src/plugins/platforms/wayland/qwaylandwindow_p.h +++ b/src/plugins/platforms/wayland/qwaylandwindow_p.h @@ -104,16 +104,16 @@ public: ~QWaylandWindow(); virtual WindowType windowType() const = 0; - WId winId() const; - void setVisible(bool visible); - void setParent(const QPlatformWindow *parent); + WId winId() const Q_DECL_OVERRIDE; + void setVisible(bool visible) Q_DECL_OVERRIDE; + void setParent(const QPlatformWindow *parent) Q_DECL_OVERRIDE; - void setWindowTitle(const QString &title); + void setWindowTitle(const QString &title) Q_DECL_OVERRIDE; inline QIcon windowIcon() const; - void setWindowIcon(const QIcon &icon); + void setWindowIcon(const QIcon &icon) Q_DECL_OVERRIDE; - void setGeometry(const QRect &rect); + void setGeometry(const QRect &rect) Q_DECL_OVERRIDE; void configure(uint32_t edges, int32_t width, int32_t height); @@ -127,7 +127,7 @@ public: void waitForFrameSync(); - QMargins frameMargins() const; + QMargins frameMargins() const Q_DECL_OVERRIDE; static QWaylandWindow *fromWlSurface(::wl_surface *surface); @@ -136,11 +136,11 @@ public: QWaylandSubSurface *subSurfaceWindow() const; QWaylandScreen *screen() const { return mScreen; } - void handleContentOrientationChange(Qt::ScreenOrientation orientation); + void handleContentOrientationChange(Qt::ScreenOrientation orientation) Q_DECL_OVERRIDE; void setOrientationMask(Qt::ScreenOrientations mask); - void setWindowState(Qt::WindowState state); - void setWindowFlags(Qt::WindowFlags flags); + void setWindowState(Qt::WindowState state) Q_DECL_OVERRIDE; + void setWindowFlags(Qt::WindowFlags flags) Q_DECL_OVERRIDE; void raise() Q_DECL_OVERRIDE; void lower() Q_DECL_OVERRIDE; @@ -176,7 +176,7 @@ public: void doResize(); void setCanResize(bool canResize); - bool setMouseGrabEnabled(bool grab); + bool setMouseGrabEnabled(bool grab) Q_DECL_OVERRIDE; static QWaylandWindow *mouseGrab() { return mMouseGrab; } void sendProperty(const QString &name, const QVariant &value); diff --git a/src/plugins/platforms/wayland/qwaylandwindowmanagerintegration_p.h b/src/plugins/platforms/wayland/qwaylandwindowmanagerintegration_p.h index 73c1b29e8a6..7abad64db17 100644 --- a/src/plugins/platforms/wayland/qwaylandwindowmanagerintegration_p.h +++ b/src/plugins/platforms/wayland/qwaylandwindowmanagerintegration_p.h @@ -71,10 +71,10 @@ public: explicit QWaylandWindowManagerIntegration(QWaylandDisplay *waylandDisplay); virtual ~QWaylandWindowManagerIntegration(); - QByteArray desktopEnvironment() const; + QByteArray desktopEnvironment() const Q_DECL_OVERRIDE; - bool openUrl(const QUrl &url); - bool openDocument(const QUrl &url); + bool openUrl(const QUrl &url) Q_DECL_OVERRIDE; + bool openDocument(const QUrl &url) Q_DECL_OVERRIDE; bool showIsFullScreen() const; From 261f31eacb4e475e80163e3c9d85bdbdc2ec99a1 Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Mon, 20 Jun 2016 13:33:13 +0200 Subject: [PATCH 6/6] Remove unused method QWaylandDisplay::lastKeyboardFocusInputDevice Change-Id: Iee19b36ae2032112e0097dc6eb2e4592697c2a1c Reviewed-by: Pier Luigi Fiorini --- src/plugins/platforms/wayland/qwaylanddisplay.cpp | 11 ----------- src/plugins/platforms/wayland/qwaylanddisplay_p.h | 4 ---- src/plugins/platforms/wayland/qwaylandinputdevice.cpp | 1 - 3 files changed, 16 deletions(-) diff --git a/src/plugins/platforms/wayland/qwaylanddisplay.cpp b/src/plugins/platforms/wayland/qwaylanddisplay.cpp index a6f52bc2432..4358bf69f6c 100644 --- a/src/plugins/platforms/wayland/qwaylanddisplay.cpp +++ b/src/plugins/platforms/wayland/qwaylanddisplay.cpp @@ -118,19 +118,8 @@ QWaylandWindowManagerIntegration *QWaylandDisplay::windowManagerIntegration() co return mWindowManagerIntegration.data(); } -QWaylandInputDevice *QWaylandDisplay::lastKeyboardFocusInputDevice() const -{ - return mLastKeyboardFocusInputDevice; -} - -void QWaylandDisplay::setLastKeyboardFocusInputDevice(QWaylandInputDevice *device) -{ - mLastKeyboardFocusInputDevice = device; -} - QWaylandDisplay::QWaylandDisplay(QWaylandIntegration *waylandIntegration) : mWaylandIntegration(waylandIntegration) - , mLastKeyboardFocusInputDevice(0) , mDndSelectionHandler(0) , mWindowExtension(0) , mSubCompositor(0) diff --git a/src/plugins/platforms/wayland/qwaylanddisplay_p.h b/src/plugins/platforms/wayland/qwaylanddisplay_p.h index b53e0577a3b..adc012b53d8 100644 --- a/src/plugins/platforms/wayland/qwaylanddisplay_p.h +++ b/src/plugins/platforms/wayland/qwaylanddisplay_p.h @@ -134,9 +134,6 @@ public: QWaylandInputDevice *defaultInputDevice() const; QWaylandInputDevice *currentInputDevice() const { return defaultInputDevice(); } - QWaylandInputDevice *lastKeyboardFocusInputDevice() const; - void setLastKeyboardFocusInputDevice(QWaylandInputDevice *device); - QWaylandDataDeviceManager *dndSelectionHandler() const { return mDndSelectionHandler.data(); } QtWayland::qt_surface_extension *windowExtension() const { return mWindowExtension.data(); } @@ -194,7 +191,6 @@ private: QList mInputDevices; QList mRegistryListeners; QWaylandIntegration *mWaylandIntegration; - QWaylandInputDevice *mLastKeyboardFocusInputDevice; QScopedPointer mDndSelectionHandler; QScopedPointer mWindowExtension; QScopedPointer mSubCompositor; diff --git a/src/plugins/platforms/wayland/qwaylandinputdevice.cpp b/src/plugins/platforms/wayland/qwaylandinputdevice.cpp index 9eda317b307..e2412eaa4a9 100644 --- a/src/plugins/platforms/wayland/qwaylandinputdevice.cpp +++ b/src/plugins/platforms/wayland/qwaylandinputdevice.cpp @@ -633,7 +633,6 @@ void QWaylandInputDevice::Keyboard::focusCallback(void *data, struct wl_callback self->mFocusCallback = 0; } - self->mParent->mQDisplay->setLastKeyboardFocusInputDevice(self->mFocus ? self->mParent : 0); QWindowSystemInterface::handleWindowActivated(self->mFocus ? self->mFocus->window() : 0); }