From acd10cd393abe04a8fd6fe3ab14055e09c85bc15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Tue, 11 Oct 2016 13:06:51 +0200 Subject: Call formatWindowTitle on the window title According to QWidget::setWindowTitle documentation the QPA plugin is responsible for adding the application name to the window title. As it's supposed to be done for Unix platform the Wayland QPA also needs to perform this task. Task-number: QTBUG-56475 Change-Id: Ib261c68d08ca06d1ec4734c8c215a4ceb059fae3 Reviewed-by: Johan Helsing Reviewed-by: Pier Luigi Fiorini --- src/client/qwaylandwindow.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp index eb9c1409..aa7b5781 100644 --- a/src/client/qwaylandwindow.cpp +++ b/src/client/qwaylandwindow.cpp @@ -137,7 +137,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). @@ -258,7 +258,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()) -- cgit v1.2.1 From 6c92fda9a71f00be801fcfc96f5f503b70fa3f00 Mon Sep 17 00:00:00 2001 From: Giulio Camuffo Date: Sat, 15 Oct 2016 09:29:54 +0200 Subject: Don't return a null QMimeData from the clipboard The documentation for QClipboard::mimeData() doesn't say that the returned value can be null, and some clients just dereference that without checking. So instead return an empty QMimeData. Change-Id: Ieec3140af4e7f33cde98ed96fd96b2674d0d0f9f Reviewed-by: Pier Luigi Fiorini Reviewed-by: Johan Helsing --- src/client/qwaylandclipboard.cpp | 6 +++--- src/client/qwaylandclipboard_p.h | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/client/qwaylandclipboard.cpp b/src/client/qwaylandclipboard.cpp index a2b7a669..5399e79d 100644 --- a/src/client/qwaylandclipboard.cpp +++ b/src/client/qwaylandclipboard.cpp @@ -54,11 +54,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) { @@ -68,7 +68,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) diff --git a/src/client/qwaylandclipboard_p.h b/src/client/qwaylandclipboard_p.h index 02223076..e9344c5f 100644 --- a/src/client/qwaylandclipboard_p.h +++ b/src/client/qwaylandclipboard_p.h @@ -47,6 +47,7 @@ #include #include +#include #include @@ -70,6 +71,7 @@ public: private: QWaylandDisplay *mDisplay; + QMimeData m_emptyData; }; } -- cgit v1.2.1 From eb1d6f4c8673b8f9c34748c8764d92e5da31971c Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Mon, 10 Oct 2016 17:52:15 +0200 Subject: Client: Remove windows from keyboard focus list when destroyed This fixes the undefined behavior in tst_WaylandClient::touchDrag and mouseDrag Note: The test still fails if run twice in a row, but it appears to be deterministic. Task-number: QTBUG-56187 Change-Id: Ib45d82224f004d1324f2ce4d6b7df05ee36c04f5 Reviewed-by: Paul Olav Tvete (cherry picked from commit 0049240a2b7d8691f09224e1542919ddbbb0d864) Reviewed-by: Johan Helsing --- src/client/qwaylanddisplay.cpp | 6 ++++++ src/client/qwaylanddisplay_p.h | 3 ++- src/client/qwaylandwindow.cpp | 2 ++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/client/qwaylanddisplay.cpp b/src/client/qwaylanddisplay.cpp index ae28eb77..f9a556f4 100644 --- a/src/client/qwaylanddisplay.cpp +++ b/src/client/qwaylanddisplay.cpp @@ -411,6 +411,12 @@ void QWaylandDisplay::handleKeyboardFocusChanged(QWaylandInputDevice *inputDevic mLastKeyboardFocus = keyboardFocus; } +void QWaylandDisplay::handleWindowDestroyed(QWaylandWindow *window) +{ + if (mActiveWindows.contains(window)) + handleWindowDeactivated(window); +} + void QWaylandDisplay::handleWaylandSync() { // This callback is used to set the window activation because we may get an activate/deactivate diff --git a/src/client/qwaylanddisplay_p.h b/src/client/qwaylanddisplay_p.h index ea127d2f..a6591648 100644 --- a/src/client/qwaylanddisplay_p.h +++ b/src/client/qwaylanddisplay_p.h @@ -170,6 +170,7 @@ public: void handleWindowActivated(QWaylandWindow *window); void handleWindowDeactivated(QWaylandWindow *window); void handleKeyboardFocusChanged(QWaylandInputDevice *inputDevice); + void handleWindowDestroyed(QWaylandWindow *window); public slots: void blockingReadEvents(); @@ -211,7 +212,7 @@ private: uint32_t mLastInputSerial; QWaylandInputDevice *mLastInputDevice; QPointer mLastInputWindow; - QWaylandWindow *mLastKeyboardFocus; + QPointer mLastKeyboardFocus; QVector mActiveWindows; struct wl_callback *mSyncCallback; static const wl_callback_listener syncCallbackListener; diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp index a1daa07f..e504de37 100644 --- a/src/client/qwaylandwindow.cpp +++ b/src/client/qwaylandwindow.cpp @@ -93,6 +93,8 @@ QWaylandWindow::QWaylandWindow(QWindow *window) QWaylandWindow::~QWaylandWindow() { + mDisplay->handleWindowDestroyed(this); + delete mWindowDecoration; if (isInitialized()) -- cgit v1.2.1 From 9d3462dff33b771b71ef16d797ee01ea10afebbe Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Thu, 23 Jun 2016 11:53:52 +0200 Subject: Client: Call parent requestUpdate after changing subsurface position Calling setPosition on a child window would not send the appropriate commit request after the wl_subsurface.set_position request. Task-number: QTBUG-52118 Change-Id: I792016ce7e0a5a2efd3a32a98727b43ee0275b0e Reviewed-by: Paul Olav Tvete Reviewed-by: Giulio Camuffo --- src/client/qwaylandwindow.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp index e504de37..4c00110b 100644 --- a/src/client/qwaylandwindow.cpp +++ b/src/client/qwaylandwindow.cpp @@ -262,6 +262,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()); } @@ -638,6 +639,8 @@ bool QWaylandWindow::createDecoration() QMargins m = frameMargins(); subsurf->set_position(pos.x() + m.left(), pos.y() + m.top()); } + if (!mChildren.isEmpty()) + window()->requestUpdate(); } return mWindowDecoration; -- cgit v1.2.1 From 785f543bed9b0f05c4f6b0de7453faab04c1c8e8 Mon Sep 17 00:00:00 2001 From: Nico Vertriest Date: Tue, 4 Oct 2016 14:30:21 +0200 Subject: Doc: Added missing documentation for certain parameters Change-Id: I6f30d9032a9f5f432aacee1b05439445933fb9d0 Reviewed-by: Johan Helsing Reviewed-by: Venugopal Shivashankar Reviewed-by: Martin Smith --- src/compositor/compositor_api/qwaylandseat.cpp | 10 +++++----- src/compositor/compositor_api/qwaylandsurface.cpp | 4 ++-- src/compositor/compositor_api/qwaylandtouch.cpp | 10 +++++----- src/compositor/extensions/qwaylandivisurface.cpp | 4 ++-- src/compositor/extensions/qwaylandxdgshellv5.cpp | 12 +++++++----- 5 files changed, 21 insertions(+), 19 deletions(-) diff --git a/src/compositor/compositor_api/qwaylandseat.cpp b/src/compositor/compositor_api/qwaylandseat.cpp index 169d5de6..f6a5276d 100644 --- a/src/compositor/compositor_api/qwaylandseat.cpp +++ b/src/compositor/compositor_api/qwaylandseat.cpp @@ -257,8 +257,8 @@ void QWaylandSeat::sendKeyReleaseEvent(uint code) } /*! - * Sends a touch point event with the given \a id and \a state to the touch device. The position - * of the touch point is given by \a point. + * Sends a touch point event to the \a surface on a touch device with the given + * \a id, \a point and \a state. * * Returns the serial for the touch up or touch down event. */ @@ -273,7 +273,7 @@ uint QWaylandSeat::sendTouchPointEvent(QWaylandSurface *surface, int id, const Q } /*! - * Sends a frame event to the touch device. + * Sends a frame event to the touch device of a \a client. */ void QWaylandSeat::sendTouchFrameEvent(QWaylandClient *client) { @@ -283,7 +283,7 @@ void QWaylandSeat::sendTouchFrameEvent(QWaylandClient *client) } /*! - * Sends a cancel event to the touch device. + * Sends a cancel event to the touch device of a \a client. */ void QWaylandSeat::sendTouchCancelEvent(QWaylandClient *client) { @@ -293,7 +293,7 @@ void QWaylandSeat::sendTouchCancelEvent(QWaylandClient *client) } /*! - * Sends the \a event to the touch device. + * Sends the \a event to the specified \a surface on the touch device. */ void QWaylandSeat::sendFullTouchEvent(QWaylandSurface *surface, QTouchEvent *event) { diff --git a/src/compositor/compositor_api/qwaylandsurface.cpp b/src/compositor/compositor_api/qwaylandsurface.cpp index 80e8715e..98db1dbe 100644 --- a/src/compositor/compositor_api/qwaylandsurface.cpp +++ b/src/compositor/compositor_api/qwaylandsurface.cpp @@ -872,13 +872,13 @@ void QWaylandSurfacePrivate::Subsurface::subsurface_set_desync(wl_subsurface::Re /*! * \qmlsignal void QtWaylandCompositor::WaylandSurface::dragStarted(object drag) * - * This signal is emitted when a drag has started from this surface. + * This signal is emitted when a \a drag has started from this surface. */ /*! * \fn void QWaylandSurface::dragStarted(QWaylandDrag *drag) * - * This signal is emitted when a drag has started from this surface. + * This signal is emitted when a \a drag has started from this surface. */ QT_END_NAMESPACE diff --git a/src/compositor/compositor_api/qwaylandtouch.cpp b/src/compositor/compositor_api/qwaylandtouch.cpp index 168edc49..92a8f5cf 100644 --- a/src/compositor/compositor_api/qwaylandtouch.cpp +++ b/src/compositor/compositor_api/qwaylandtouch.cpp @@ -133,7 +133,7 @@ QWaylandCompositor *QWaylandTouch::compositor() const } /*! - * Sends a touch point event for the touch device with the given \a id, + * Sends a touch point event to the touch device of \a surface with the given \a id, * \a position, and \a state. * * Returns the serial of the down or up event if sent, otherwise 0. @@ -162,7 +162,7 @@ uint QWaylandTouch::sendTouchPointEvent(QWaylandSurface *surface, int id, const } /*! - * Sends a touch frame event for the touch device. This indicates the end of a + * Sends a touch frame event to the touch device of a \a client. This indicates the end of a * contact point list. */ void QWaylandTouch::sendFrameEvent(QWaylandClient *client) @@ -174,7 +174,7 @@ void QWaylandTouch::sendFrameEvent(QWaylandClient *client) } /*! - * Sends a touch cancel event for the touch device. + * Sends a touch cancel event to the touch device of a \a client. */ void QWaylandTouch::sendCancelEvent(QWaylandClient *client) { @@ -185,8 +185,8 @@ void QWaylandTouch::sendCancelEvent(QWaylandClient *client) } /*! - * Sends all the touch points in \a event for this touch device, followed - * by a touch frame event. + * Sends all touch points in \a event to the specified \a surface, + * followed by a touch frame event. * * \sa sendTouchPointEvent(), sendFrameEvent() */ diff --git a/src/compositor/extensions/qwaylandivisurface.cpp b/src/compositor/extensions/qwaylandivisurface.cpp index fc3102df..06e12a5a 100644 --- a/src/compositor/extensions/qwaylandivisurface.cpp +++ b/src/compositor/extensions/qwaylandivisurface.cpp @@ -68,7 +68,7 @@ QWaylandIviSurface::QWaylandIviSurface() /*! * Constructs a QWaylandIviSurface for \a surface and initializes it with the - * given \a application, \a surface, \a iviId, and resource \a res. + * given \a application, \a surface, \a iviId, and \a resource. */ QWaylandIviSurface::QWaylandIviSurface(QWaylandIviApplication *application, QWaylandSurface *surface, uint iviId, const QWaylandResource &resource) : QWaylandShellSurfaceTemplate(*new QWaylandIviSurfacePrivate()) @@ -129,7 +129,7 @@ QWaylandSurface *QWaylandIviSurface::surface() const */ /*! - * \property QWaylandClient::iviId + * \property QWaylandIviSurface::iviId * * This property holds the ivi id of this QWaylandIviSurface. */ diff --git a/src/compositor/extensions/qwaylandxdgshellv5.cpp b/src/compositor/extensions/qwaylandxdgshellv5.cpp index b73b84d7..fd23865c 100644 --- a/src/compositor/extensions/qwaylandxdgshellv5.cpp +++ b/src/compositor/extensions/qwaylandxdgshellv5.cpp @@ -912,13 +912,15 @@ QSize QWaylandXdgSurfaceV5::sizeForResize(const QSizeF &size, const QPointF &del } /*! - * \qmlmethod int QtWaylandCompositor::XdgSurface::sendConfigure(size size, List) + * \qmlmethod int QtWaylandCompositor::XdgSurface::sendConfigure(size size, list states) * - * Sends a configure event to the client. Known states are enumerated in XdgSurface::State + * Sends a configure event to the client. \a size contains the pixel size of the surface. + * Known \a states are enumerated in XdgSurface::State. */ /*! - * Sends a configure event to the client. Known states are enumerated in QWaylandXdgSurfaceV5::State + * Sends a configure event to the client. Parameter \a size contains the pixel size + * of the surface. Known \a states are enumerated in QWaylandXdgSurfaceV5::State. */ uint QWaylandXdgSurfaceV5::sendConfigure(const QSize &size, const QVector &states) { @@ -1038,8 +1040,8 @@ QWaylandXdgPopupV5::QWaylandXdgPopupV5() } /*! - * Constructs a QWaylandXdgPopupV5 for \a surface and initializes it with the - * given \a parentSurface and \a resource. + * Constructs a QWaylandXdgPopupV5, associating it with \a xdgShell at the specified \a position + * for \a surface and initializes it with the given \a parentSurface and \a resource. */ QWaylandXdgPopupV5::QWaylandXdgPopupV5(QWaylandXdgShellV5 *xdgShell, QWaylandSurface *surface, QWaylandSurface *parentSurface, const QPoint &position, const QWaylandResource &resource) -- cgit v1.2.1 From 59965ed2277bb62e0ec38b149b570285828660fd Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Thu, 3 Nov 2016 14:39:39 +0100 Subject: Don't ignore wl_surface:attach with null buffer Update the bufferRef to null so the surface gets hidden. This fixes an issue with popups not popping down properly. Change-Id: Ie6781c0e935998035e06c8498035d786f06a1fe0 Reviewed-by: Paul Olav Tvete --- src/compositor/compositor_api/qwaylandsurface.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compositor/compositor_api/qwaylandsurface.cpp b/src/compositor/compositor_api/qwaylandsurface.cpp index 98db1dbe..f79fd57e 100644 --- a/src/compositor/compositor_api/qwaylandsurface.cpp +++ b/src/compositor/compositor_api/qwaylandsurface.cpp @@ -269,7 +269,7 @@ void QWaylandSurfacePrivate::surface_commit(Resource *) { Q_Q(QWaylandSurface); - if (pending.buffer.hasBuffer()) + if (pending.buffer.hasBuffer() || pending.newlyAttached) bufferRef = pending.buffer; auto buffer = bufferRef.buffer(); -- cgit v1.2.1 From 0b230b7dfd32c510c6351e563768195f7663befe Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 3 Nov 2016 18:24:59 +0100 Subject: remove dependencies from sync.profile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit the CI obtains them from the qt5 super repo nowadays. Change-Id: I93b3231e94c15b93544b53bcfe72a18e4309903c Reviewed-by: JÄ™drzej Nowacki --- sync.profile | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/sync.profile b/sync.profile index 5bff7535..be369663 100644 --- a/sync.profile +++ b/sync.profile @@ -8,14 +8,3 @@ ); %deprecatedheaders = ( ); -# Module dependencies. -# Every module that is required to build this module should have one entry. -# Each of the module version specifiers can take one of the following values: -# - A specific Git revision. -# - any git symbolic ref resolvable from the module's repository (e.g. "refs/heads/master" to track master branch) -# - an empty string to use the same branch under test (dependencies will become "refs/heads/master" if we are in the master branch) -# -%dependencies = ( - "qtbase" => "", - "qtdeclarative" => "", -); -- cgit v1.2.1 From 18eedea179ef4636f114b38832330cb424090f73 Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Wed, 2 Nov 2016 14:24:52 +0100 Subject: Fix build when some features are disabled Make QtWaylandClient compile when Qt is configured with: -no-opengl -no-accessibility -D QT_NO_CLIPBOARD -D QT_NO_DRAGANDDROP -D QT_NO_SESSIONMANAGER Task-number: QTBUG-56192 Change-Id: Idc6aae6b36a35515109a27bed31a22e3e909ef27 Reviewed-by: Giulio Camuffo --- src/client/qwaylandclipboard.cpp | 4 ++++ src/client/qwaylandclipboard_p.h | 3 +++ src/client/qwaylanddatadevice.cpp | 4 ++++ src/client/qwaylanddatadevice_p.h | 4 ++++ src/client/qwaylanddatadevicemanager.cpp | 4 ++++ src/client/qwaylanddatadevicemanager_p.h | 4 ++++ src/client/qwaylanddataoffer.cpp | 4 ++++ src/client/qwaylanddataoffer_p.h | 3 ++- src/client/qwaylanddatasource.cpp | 4 ++++ src/client/qwaylanddatasource_p.h | 4 ++++ src/client/qwaylanddisplay.cpp | 6 ++++++ src/client/qwaylanddisplay_p.h | 6 ++++-- src/client/qwaylanddnd.cpp | 4 ++-- src/client/qwaylanddnd_p.h | 4 ++-- src/client/qwaylandinputdevice.cpp | 3 ++- src/client/qwaylandintegration.cpp | 7 ++++++- src/client/qwaylandintegration_p.h | 7 ++++--- src/client/qwaylandnativeinterface.cpp | 2 ++ src/client/qwaylandnativeinterface_p.h | 3 ++- src/client/qwaylandwindow.cpp | 2 ++ 20 files changed, 69 insertions(+), 13 deletions(-) diff --git a/src/client/qwaylandclipboard.cpp b/src/client/qwaylandclipboard.cpp index 5399e79d..c661c1b6 100644 --- a/src/client/qwaylandclipboard.cpp +++ b/src/client/qwaylandclipboard.cpp @@ -38,6 +38,8 @@ #include "qwaylanddatasource_p.h" #include "qwaylanddatadevice_p.h" +#ifndef QT_NO_DRAGANDDROP + QT_BEGIN_NAMESPACE namespace QtWaylandClient { @@ -109,3 +111,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 e9344c5f..d3553574 100644 --- a/src/client/qwaylandclipboard_p.h +++ b/src/client/qwaylandclipboard_p.h @@ -51,6 +51,7 @@ #include +#ifndef QT_NO_DRAGANDDROP QT_BEGIN_NAMESPACE namespace QtWaylandClient { @@ -78,4 +79,6 @@ private: QT_END_NAMESPACE +#endif // QT_NO_DRAGANDDROP + #endif // QWAYLANDCLIPBOARD_H diff --git a/src/client/qwaylanddatadevice.cpp b/src/client/qwaylanddatadevice.cpp index 255b13f4..10033126 100644 --- a/src/client/qwaylanddatadevice.cpp +++ b/src/client/qwaylanddatadevice.cpp @@ -55,6 +55,8 @@ #include #include +#ifndef QT_NO_DRAGANDDROP + QT_BEGIN_NAMESPACE namespace QtWaylandClient { @@ -254,3 +256,5 @@ void QWaylandDataDevice::dragSourceTargetChanged(const QString &mimeType) } QT_END_NAMESPACE + +#endif // QT_NO_DRAGANDDROP diff --git a/src/client/qwaylanddatadevice_p.h b/src/client/qwaylanddatadevice_p.h index b87529e9..04ff7b38 100644 --- a/src/client/qwaylanddatadevice_p.h +++ b/src/client/qwaylanddatadevice_p.h @@ -57,6 +57,8 @@ #include +#ifndef QT_NO_DRAGANDDROP + QT_BEGIN_NAMESPACE class QMimeData; @@ -117,4 +119,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 b5a98b09..b3053d3c 100644 --- a/src/client/qwaylanddatadevicemanager.cpp +++ b/src/client/qwaylanddatadevicemanager.cpp @@ -40,6 +40,8 @@ #include +#ifndef QT_NO_DRAGANDDROP + QT_BEGIN_NAMESPACE namespace QtWaylandClient { @@ -74,3 +76,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 85b4b3f7..63451d82 100644 --- a/src/client/qwaylanddatadevicemanager_p.h +++ b/src/client/qwaylanddatadevicemanager_p.h @@ -48,6 +48,8 @@ #include #include +#ifndef QT_NO_DRAGANDDROP + QT_BEGIN_NAMESPACE namespace QtWaylandClient { @@ -75,4 +77,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 167b647d..4c4ac3d8 100644 --- a/src/client/qwaylanddataoffer.cpp +++ b/src/client/qwaylanddataoffer.cpp @@ -41,6 +41,8 @@ #include +#ifndef QT_NO_DRAGANDDROP + QT_BEGIN_NAMESPACE namespace QtWaylandClient { @@ -175,3 +177,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 b22681f7..d30a5fba 100644 --- a/src/client/qwaylanddataoffer_p.h +++ b/src/client/qwaylanddataoffer_p.h @@ -50,6 +50,7 @@ #include #include +#ifndef QT_NO_DRAGANDDROP QT_BEGIN_NAMESPACE namespace QtWaylandClient { @@ -99,5 +100,5 @@ private: } QT_END_NAMESPACE - +#endif // QT_NO_DRAGANDDROP #endif diff --git a/src/client/qwaylanddatasource.cpp b/src/client/qwaylanddatasource.cpp index ad43b069..30b7e620 100644 --- a/src/client/qwaylanddatasource.cpp +++ b/src/client/qwaylanddatasource.cpp @@ -43,6 +43,8 @@ #include +#ifndef QT_NO_DRAGANDDROP + QT_BEGIN_NAMESPACE namespace QtWaylandClient { @@ -90,3 +92,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 c753c4f6..72530d0b 100644 --- a/src/client/qwaylanddatasource_p.h +++ b/src/client/qwaylanddatasource_p.h @@ -50,6 +50,8 @@ #include #include +#ifndef QT_NO_DRAGANDDROP + QT_BEGIN_NAMESPACE class QMimeData; @@ -86,4 +88,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 f9a556f4..534ae494 100644 --- a/src/client/qwaylanddisplay.cpp +++ b/src/client/qwaylanddisplay.cpp @@ -112,7 +112,9 @@ QWaylandWindowManagerIntegration *QWaylandDisplay::windowManagerIntegration() co QWaylandDisplay::QWaylandDisplay(QWaylandIntegration *waylandIntegration) : mWaylandIntegration(waylandIntegration) +#ifndef QT_NO_DRAGANDDROP , mDndSelectionHandler(0) +#endif , mWindowExtension(0) , mSubCompositor(0) , mTouchExtension(0) @@ -150,7 +152,9 @@ QWaylandDisplay::~QWaylandDisplay(void) mWaylandIntegration->destroyScreen(screen); } mScreens.clear(); +#ifndef QT_NO_DRAGANDDROP delete mDndSelectionHandler.take(); +#endif wl_display_disconnect(mDisplay); } @@ -243,8 +247,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 a6591648..cc1308ba 100644 --- a/src/client/qwaylanddisplay_p.h +++ b/src/client/qwaylanddisplay_p.h @@ -131,9 +131,9 @@ public: QList 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::wl_text_input_manager *textInputManager() const { return mTextInputManager.data(); } @@ -196,7 +196,9 @@ private: QList mInputDevices; QList mRegistryListeners; QWaylandIntegration *mWaylandIntegration; +#ifndef QT_NO_DRAGANDDROP QScopedPointer mDndSelectionHandler; +#endif QScopedPointer mWindowExtension; QScopedPointer mSubCompositor; QScopedPointer mTouchExtension; diff --git a/src/client/qwaylanddnd.cpp b/src/client/qwaylanddnd.cpp index e195d193..31b1c491 100644 --- a/src/client/qwaylanddnd.cpp +++ b/src/client/qwaylanddnd.cpp @@ -44,7 +44,7 @@ #include QT_BEGIN_NAMESPACE - +#ifndef QT_NO_DRAGANDDROP namespace QtWaylandClient { QWaylandDrag::QWaylandDrag(QWaylandDisplay *display) @@ -124,5 +124,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 42848a1d..a4fd91e9 100644 --- a/src/client/qwaylanddnd_p.h +++ b/src/client/qwaylanddnd_p.h @@ -58,7 +58,7 @@ QT_BEGIN_NAMESPACE namespace QtWaylandClient { class QWaylandDisplay; - +#ifndef QT_NO_DRAGANDDROP class Q_WAYLAND_CLIENT_EXPORT QWaylandDrag : public QBasicDrag { public: @@ -82,7 +82,7 @@ protected: private: QWaylandDisplay *m_display; }; - +#endif } QT_END_NAMESPACE diff --git a/src/client/qwaylandinputdevice.cpp b/src/client/qwaylandinputdevice.cpp index 5eaed9ea..6c72c59d 100644 --- a/src/client/qwaylandinputdevice.cpp +++ b/src/client/qwaylandinputdevice.cpp @@ -178,10 +178,11 @@ QWaylandInputDevice::QWaylandInputDevice(QWaylandDisplay *display, int version, , mSerial(0) , mTouchDevice(0) { +#ifndef QT_NO_DRAGANDDROP if (mQDisplay->dndSelectionHandler()) { mDataDevice = mQDisplay->dndSelectionHandler()->getDataDevice(this); } - +#endif } QWaylandInputDevice::~QWaylandInputDevice() diff --git a/src/client/qwaylandintegration.cpp b/src/client/qwaylandintegration.cpp index 17b3f681..106e54c6 100644 --- a/src/client/qwaylandintegration.cpp +++ b/src/client/qwaylandintegration.cpp @@ -126,9 +126,10 @@ QWaylandIntegration::QWaylandIntegration() { initializeInputDeviceIntegration(); mDisplay = new QWaylandDisplay(this); +#ifndef QT_NO_DRAGANDDROP mClipboard = new QWaylandClipboard(mDisplay); mDrag = new QWaylandDrag(mDisplay); - +#endif QString icStr = QPlatformInputContextFactory::requested(); icStr.isNull() ? mInputContext.reset(new QWaylandInputContext(mDisplay)) : mInputContext.reset(QPlatformInputContextFactory::create(icStr)); @@ -136,8 +137,10 @@ QWaylandIntegration::QWaylandIntegration() QWaylandIntegration::~QWaylandIntegration() { +#ifndef QT_NO_DRAGANDDROP delete mDrag; delete mClipboard; +#endif #ifndef QT_NO_ACCESSIBILITY delete mAccessibility; #endif @@ -213,6 +216,7 @@ QPlatformFontDatabase *QWaylandIntegration::fontDatabase() const return mFontDb; } +#ifndef QT_NO_DRAGANDDROP QPlatformClipboard *QWaylandIntegration::clipboard() const { return mClipboard; @@ -222,6 +226,7 @@ QPlatformDrag *QWaylandIntegration::drag() const { return mDrag; } +#endif // QT_NO_DRAGANDDROP QPlatformInputContext *QWaylandIntegration::inputContext() const { diff --git a/src/client/qwaylandintegration_p.h b/src/client/qwaylandintegration_p.h index b6a71535..8d975924 100644 --- a/src/client/qwaylandintegration_p.h +++ b/src/client/qwaylandintegration_p.h @@ -79,11 +79,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; @@ -120,8 +119,10 @@ private: QWaylandShellIntegration *createShellIntegration(const QString& interfaceName); QPlatformFontDatabase *mFontDb; +#ifndef QT_NO_DRAGANDDROP QPlatformClipboard *mClipboard; QPlatformDrag *mDrag; +#endif QWaylandDisplay *mDisplay; QPlatformNativeInterface *mNativeInterface; QScopedPointer mInputContext; diff --git a/src/client/qwaylandnativeinterface.cpp b/src/client/qwaylandnativeinterface.cpp index 98e1a736..aad69de3 100644 --- a/src/client/qwaylandnativeinterface.cpp +++ b/src/client/qwaylandnativeinterface.cpp @@ -106,6 +106,7 @@ void *QWaylandNativeInterface::nativeResourceForScreen(const QByteArray &resourc return NULL; } +#ifndef QT_NO_OPENGL void *QWaylandNativeInterface::nativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) { QByteArray lowerCaseResource = resource.toLower(); @@ -121,6 +122,7 @@ void *QWaylandNativeInterface::nativeResourceForContext(const QByteArray &resour return 0; } +#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 b4cb8fcb..cace9c33 100644 --- a/src/client/qwaylandnativeinterface_p.h +++ b/src/client/qwaylandnativeinterface_p.h @@ -66,8 +66,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 4c00110b..354e97f2 100644 --- a/src/client/qwaylandwindow.cpp +++ b/src/client/qwaylandwindow.cpp @@ -782,10 +782,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 -- cgit v1.2.1 From d7442a31ffa464a5158bd4467941494e99098c56 Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Mon, 7 Nov 2016 13:26:04 +0100 Subject: Don't create new xdg surfaces in updateTransientParent Change-Id: I1644a75269fec40644f02eeb275d9e6b98995c0e Reviewed-by: Paul Olav Tvete --- src/client/qwaylandxdgsurface.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/client/qwaylandxdgsurface.cpp b/src/client/qwaylandxdgsurface.cpp index f44e2d9f..76456495 100644 --- a/src/client/qwaylandxdgsurface.cpp +++ b/src/client/qwaylandxdgsurface.cpp @@ -132,7 +132,9 @@ void QWaylandXdgSurface::updateTransientParent(QWindow *parent) QWaylandWindow *parent_wayland_window = static_cast(parent->handle()); if (!parent_wayland_window) return; - set_parent(m_shell->get_xdg_surface(parent_wayland_window->object())); + auto parentXdgSurface = qobject_cast(parent_wayland_window->shellSurface()); + Q_ASSERT(parentXdgSurface); + set_parent(parentXdgSurface->object()); } void QWaylandXdgSurface::setTitle(const QString & title) -- cgit v1.2.1 From 296912c3a3ccdc48cdc318d761b4154a8d7db359 Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Wed, 12 Oct 2016 14:29:01 +0200 Subject: Client: Fix touch getting stuck after drag-and-drop wl_touch.up is not sent by compositors when dragging, so release all touch points when the drag ends. Task-number: QTBUG-56187 Change-Id: I1c3d03c72e75a551355c50bb5d82433f5e2e35f0 Reviewed-by: Paul Olav Tvete --- src/client/qwaylanddnd.cpp | 2 +- src/client/qwaylandinputdevice.cpp | 16 ++++++++++++++++ src/client/qwaylandinputdevice_p.h | 2 ++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/client/qwaylanddnd.cpp b/src/client/qwaylanddnd.cpp index 31b1c491..7c2cc8ee 100644 --- a/src/client/qwaylanddnd.cpp +++ b/src/client/qwaylanddnd.cpp @@ -91,7 +91,7 @@ void QWaylandDrag::drop(const QPoint &globalPos) void QWaylandDrag::endDrag() { - // Do nothing + m_display->currentInputDevice()->handleEndDrag(); } void QWaylandDrag::updateTarget(const QString &mimeType) diff --git a/src/client/qwaylandinputdevice.cpp b/src/client/qwaylandinputdevice.cpp index 6c72c59d..669deac2 100644 --- a/src/client/qwaylandinputdevice.cpp +++ b/src/client/qwaylandinputdevice.cpp @@ -256,6 +256,12 @@ void QWaylandInputDevice::handleWindowDestroyed(QWaylandWindow *window) mTouch->mFocus = 0; } +void QWaylandInputDevice::handleEndDrag() +{ + if (mTouch) + mTouch->releasePoints(); +} + void QWaylandInputDevice::setDataDevice(QWaylandDataDevice *device) { mDataDevice = device; @@ -827,6 +833,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 e38ad2f8..f1a82d45 100644 --- a/src/client/qwaylandinputdevice_p.h +++ b/src/client/qwaylandinputdevice_p.h @@ -98,6 +98,7 @@ public: void setCursor(struct wl_buffer *buffer, const QPoint &hotSpot, const QSize &size); void setCursor(const QSharedPointer &buffer, const QPoint &hotSpot); void handleWindowDestroyed(QWaylandWindow *window); + void handleEndDrag(); void setDataDevice(QWaylandDataDevice *device); QWaylandDataDevice *dataDevice() const; @@ -259,6 +260,7 @@ public: void touch_cancel() Q_DECL_OVERRIDE; bool allTouchPointsReleased(); + void releasePoints(); QWaylandInputDevice *mParent; QWaylandWindow *mFocus; -- cgit v1.2.1 From f7a386eeaec8e6314c1be7de5e14e9fe3847f9ba Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Wed, 12 Oct 2016 15:29:30 +0200 Subject: Client: Cleanup mouse state after drag Fixes an issue where dragging with the mouse would cause the next touch event to not generate a synthesized mouse press event. The touchDrag test can now be run directly after the mouseDrag test without failing. Task-number: QTBUG-56187 Change-Id: I53cc5f90fc8d8672936b23f54a017687d41c31fc Reviewed-by: Paul Olav Tvete --- src/client/qwaylandinputdevice.cpp | 10 ++++++++++ src/client/qwaylandinputdevice_p.h | 2 ++ 2 files changed, 12 insertions(+) diff --git a/src/client/qwaylandinputdevice.cpp b/src/client/qwaylandinputdevice.cpp index 669deac2..c3b6cf45 100644 --- a/src/client/qwaylandinputdevice.cpp +++ b/src/client/qwaylandinputdevice.cpp @@ -260,6 +260,8 @@ void QWaylandInputDevice::handleEndDrag() { if (mTouch) mTouch->releasePoints(); + if (mPointer) + mPointer->releaseButtons(); } void QWaylandInputDevice::setDataDevice(QWaylandDataDevice *device) @@ -516,6 +518,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: diff --git a/src/client/qwaylandinputdevice_p.h b/src/client/qwaylandinputdevice_p.h index f1a82d45..a615e266 100644 --- a/src/client/qwaylandinputdevice_p.h +++ b/src/client/qwaylandinputdevice_p.h @@ -228,6 +228,8 @@ public: uint32_t axis, wl_fixed_t value) Q_DECL_OVERRIDE; + void releaseButtons(); + QWaylandInputDevice *mParent; QWaylandWindow *mFocus; uint32_t mEnterSerial; -- cgit v1.2.1 From c88b5f632c767bee17c8b8df60af3d11724b2e5b Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Thu, 3 Nov 2016 16:32:20 +0100 Subject: Follow the protocol for nested xdg_popups The previous implementation sent the wrong parent for nested popups and used a new serial for each popup instead of reusing the one for the current grab. Change-Id: I22b1cbe997a64562d47275821c9146157c51bc42 Reviewed-by: Paul Olav Tvete --- src/client/qwaylandxdgshell.cpp | 21 +++++++++++++++++---- src/client/qwaylandxdgshell_p.h | 4 ++++ 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/src/client/qwaylandxdgshell.cpp b/src/client/qwaylandxdgshell.cpp index 6a378b8d..6a993060 100644 --- a/src/client/qwaylandxdgshell.cpp +++ b/src/client/qwaylandxdgshell.cpp @@ -54,11 +54,13 @@ namespace QtWaylandClient { QWaylandXdgShell::QWaylandXdgShell(struct ::xdg_shell *shell) : QtWayland::xdg_shell(shell) + , m_popupSerial(0) { } QWaylandXdgShell::QWaylandXdgShell(struct ::wl_registry *registry, uint32_t id) : QtWayland::xdg_shell(registry, id, 1) + , m_popupSerial(0) { use_unstable_version(QtWayland::xdg_shell::version_current); } @@ -75,15 +77,26 @@ QWaylandXdgSurface *QWaylandXdgShell::createXdgSurface(QWaylandWindow *window) QWaylandXdgPopup *QWaylandXdgShell::createXdgPopup(QWaylandWindow *window) { - QWaylandWindow *parentWindow = window->transientParent(); + QWaylandWindow *parentWindow = m_popups.empty() ? window->transientParent() : m_popups.last(); ::wl_surface *parentSurface = parentWindow->object(); + QWaylandInputDevice *inputDevice = window->display()->lastInputDevice(); + if (m_popupSerial == 0) + m_popupSerial = inputDevice->serial(); ::wl_seat *seat = inputDevice->wl_seat(); - uint serial = inputDevice->serial(); - QPoint position = window->geometry().topLeft(); + + QPoint position = window->geometry().topLeft() - parentWindow->geometry().topLeft(); int x = position.x() + parentWindow->frameMargins().left(); int y = position.y() + parentWindow->frameMargins().top(); - return new QWaylandXdgPopup(get_xdg_popup(window->object(), parentSurface, seat, serial, x, y), window); + + auto popup = new QWaylandXdgPopup(get_xdg_popup(window->object(), parentSurface, seat, m_popupSerial, x, y), window); + m_popups.append(window); + QObject::connect(popup, &QWaylandXdgPopup::destroyed, [this, window](){ + m_popups.removeOne(window); + if (m_popups.empty()) + m_popupSerial = 0; + }); + return popup; } void QWaylandXdgShell::xdg_shell_ping(uint32_t serial) diff --git a/src/client/qwaylandxdgshell_p.h b/src/client/qwaylandxdgshell_p.h index c04a9ce6..8b35e36a 100644 --- a/src/client/qwaylandxdgshell_p.h +++ b/src/client/qwaylandxdgshell_p.h @@ -52,6 +52,7 @@ // #include +#include #include @@ -82,6 +83,9 @@ public: private: void xdg_shell_ping(uint32_t serial) Q_DECL_OVERRIDE; + + QVector m_popups; + uint m_popupSerial; }; QT_END_NAMESPACE -- cgit v1.2.1 From 70740da8978cb87b269fcaa73d71595c3c396545 Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Fri, 4 Nov 2016 10:32:01 +0100 Subject: Remove QWaylandWindow::shellManagesActiveState If m_shellSurface was deleted, there was no way for QWaylandDisplay to know whether the shell handled window deactivation or not. The shell integration now always handles the window active state. The default implementation of QWaylandShellIntegration will make a window active on keyboard focus. Change-Id: I80cfce9976b1d3c57094fdd8980c9110b873f239 Reviewed-by: Paul Olav Tvete --- src/client/qwaylanddisplay.cpp | 6 +----- src/client/qwaylandshellsurface_p.h | 1 - src/client/qwaylandwindow.cpp | 5 ----- src/client/qwaylandwindow_p.h | 2 -- src/client/qwaylandwlshellintegration.cpp | 6 ++++++ src/client/qwaylandwlshellintegration_p.h | 2 +- src/client/qwaylandxdgshellintegration.cpp | 13 +++++++++++++ src/client/qwaylandxdgshellintegration_p.h | 3 ++- src/client/qwaylandxdgsurface_p.h | 2 -- src/client/shellintegration/qwaylandshellintegration_p.h | 15 ++++++++++++++- .../ivi-shell/qwaylandivishellintegration.cpp | 1 + 11 files changed, 38 insertions(+), 18 deletions(-) diff --git a/src/client/qwaylanddisplay.cpp b/src/client/qwaylanddisplay.cpp index 5f2c4e2e..de38e3f2 100644 --- a/src/client/qwaylanddisplay.cpp +++ b/src/client/qwaylanddisplay.cpp @@ -419,11 +419,7 @@ void QWaylandDisplay::handleKeyboardFocusChanged(QWaylandInputDevice *inputDevic if (mLastKeyboardFocus == keyboardFocus) return; - if (keyboardFocus && !keyboardFocus->shellManagesActiveState()) - handleWindowActivated(keyboardFocus); - - if (mLastKeyboardFocus && !mLastKeyboardFocus->shellManagesActiveState()) - handleWindowDeactivated(mLastKeyboardFocus); + mWaylandIntegration->mShellIntegration->handleKeyboardFocusChanged(keyboardFocus, mLastKeyboardFocus); mLastKeyboardFocus = keyboardFocus; } diff --git a/src/client/qwaylandshellsurface_p.h b/src/client/qwaylandshellsurface_p.h index 79f65b15..63b77ab3 100644 --- a/src/client/qwaylandshellsurface_p.h +++ b/src/client/qwaylandshellsurface_p.h @@ -91,7 +91,6 @@ public: virtual void setContentOrientationMask(Qt::ScreenOrientations orientation) { Q_UNUSED(orientation) } virtual void sendProperty(const QString &name, const QVariant &value); - virtual bool shellManagesActiveState() const { return false; } inline QWaylandWindow *window() { return m_window; } diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp index 6b9dde7c..e72ed770 100644 --- a/src/client/qwaylandwindow.cpp +++ b/src/client/qwaylandwindow.cpp @@ -530,11 +530,6 @@ QWaylandSubSurface *QWaylandWindow::subSurfaceWindow() const return mSubSurfaceWindow; } -bool QWaylandWindow::shellManagesActiveState() const -{ - return mShellSurface && mShellSurface->shellManagesActiveState(); -} - void QWaylandWindow::handleContentOrientationChange(Qt::ScreenOrientation orientation) { if (mDisplay->compositorVersion() < 2) diff --git a/src/client/qwaylandwindow_p.h b/src/client/qwaylandwindow_p.h index e0c42ace..442fe9ad 100644 --- a/src/client/qwaylandwindow_p.h +++ b/src/client/qwaylandwindow_p.h @@ -143,8 +143,6 @@ public: QWaylandSubSurface *subSurfaceWindow() const; QWaylandScreen *screen() const { return mScreen; } - bool shellManagesActiveState() const; - void handleContentOrientationChange(Qt::ScreenOrientation orientation) Q_DECL_OVERRIDE; void setOrientationMask(Qt::ScreenOrientations mask); diff --git a/src/client/qwaylandwlshellintegration.cpp b/src/client/qwaylandwlshellintegration.cpp index 6a9220d2..ce7c7834 100644 --- a/src/client/qwaylandwlshellintegration.cpp +++ b/src/client/qwaylandwlshellintegration.cpp @@ -52,6 +52,12 @@ QWaylandWlShellIntegration::QWaylandWlShellIntegration(QWaylandDisplay *display) } } +bool QWaylandWlShellIntegration::initialize(QWaylandDisplay *display) +{ + QWaylandShellIntegration::initialize(display); + return m_wlShell != nullptr; +}; + QWaylandShellSurface *QWaylandWlShellIntegration::createShellSurface(QWaylandWindow *window) { return new QWaylandWlShellSurface(m_wlShell->get_shell_surface(window->object()), window); diff --git a/src/client/qwaylandwlshellintegration_p.h b/src/client/qwaylandwlshellintegration_p.h index 8531eb3a..9082c762 100644 --- a/src/client/qwaylandwlshellintegration_p.h +++ b/src/client/qwaylandwlshellintegration_p.h @@ -58,7 +58,7 @@ class Q_WAYLAND_CLIENT_EXPORT QWaylandWlShellIntegration : public QWaylandShellI { public: QWaylandWlShellIntegration(QWaylandDisplay* display); - bool initialize(QWaylandDisplay *) Q_DECL_OVERRIDE { return m_wlShell != Q_NULLPTR; } + bool initialize(QWaylandDisplay *) Q_DECL_OVERRIDE; QWaylandShellSurface *createShellSurface(QWaylandWindow *window) Q_DECL_OVERRIDE; private: diff --git a/src/client/qwaylandxdgshellintegration.cpp b/src/client/qwaylandxdgshellintegration.cpp index b6b1d9d3..a48157df 100644 --- a/src/client/qwaylandxdgshellintegration.cpp +++ b/src/client/qwaylandxdgshellintegration.cpp @@ -54,6 +54,12 @@ QWaylandXdgShellIntegration::QWaylandXdgShellIntegration(QWaylandDisplay *displa } } +bool QWaylandXdgShellIntegration::initialize(QWaylandDisplay *display) +{ + QWaylandShellIntegration::initialize(display); + return m_xdgShell != nullptr; +} + QWaylandShellSurface *QWaylandXdgShellIntegration::createShellSurface(QWaylandWindow *window) { if (window->window()->type() == Qt::WindowType::Popup) @@ -62,6 +68,13 @@ QWaylandShellSurface *QWaylandXdgShellIntegration::createShellSurface(QWaylandWi return m_xdgShell->createXdgSurface(window); } +void QWaylandXdgShellIntegration::handleKeyboardFocusChanged(QWaylandWindow *newFocus, QWaylandWindow *oldFocus) { + if (newFocus && qobject_cast(newFocus->shellSurface())) + m_display->handleWindowActivated(newFocus); + if (oldFocus && qobject_cast(oldFocus->shellSurface())) + m_display->handleWindowDeactivated(oldFocus); +} + } QT_END_NAMESPACE diff --git a/src/client/qwaylandxdgshellintegration_p.h b/src/client/qwaylandxdgshellintegration_p.h index 29374ff1..e0e6bda0 100644 --- a/src/client/qwaylandxdgshellintegration_p.h +++ b/src/client/qwaylandxdgshellintegration_p.h @@ -59,8 +59,9 @@ class Q_WAYLAND_CLIENT_EXPORT QWaylandXdgShellIntegration : public QWaylandShell { public: QWaylandXdgShellIntegration(QWaylandDisplay *display); - bool initialize(QWaylandDisplay *) Q_DECL_OVERRIDE { return m_xdgShell != Q_NULLPTR; } + bool initialize(QWaylandDisplay *display) Q_DECL_OVERRIDE; QWaylandShellSurface *createShellSurface(QWaylandWindow *window) Q_DECL_OVERRIDE; + void handleKeyboardFocusChanged(QWaylandWindow *newFocus, QWaylandWindow *oldFocus) Q_DECL_OVERRIDE; private: QWaylandXdgShell *m_xdgShell; diff --git a/src/client/qwaylandxdgsurface_p.h b/src/client/qwaylandxdgsurface_p.h index 27decabb..1a5eeed7 100644 --- a/src/client/qwaylandxdgsurface_p.h +++ b/src/client/qwaylandxdgsurface_p.h @@ -96,8 +96,6 @@ public: void setWindowFlags(Qt::WindowFlags flags) Q_DECL_OVERRIDE; void sendProperty(const QString &name, const QVariant &value) Q_DECL_OVERRIDE; - bool shellManagesActiveState() const Q_DECL_OVERRIDE { return true; } - bool isFullscreen() const { return m_fullscreen; } bool isMaximized() const { return m_maximized; } diff --git a/src/client/shellintegration/qwaylandshellintegration_p.h b/src/client/shellintegration/qwaylandshellintegration_p.h index e8e46eca..144e5835 100644 --- a/src/client/shellintegration/qwaylandshellintegration_p.h +++ b/src/client/shellintegration/qwaylandshellintegration_p.h @@ -53,6 +53,7 @@ #include #include +#include QT_BEGIN_NAMESPACE @@ -68,8 +69,20 @@ public: QWaylandShellIntegration() {} virtual ~QWaylandShellIntegration() {} - virtual bool initialize(QWaylandDisplay *display) = 0; + virtual bool initialize(QWaylandDisplay *display) { + m_display = display; + return true; + } virtual QWaylandShellSurface *createShellSurface(QWaylandWindow *window) = 0; + virtual void handleKeyboardFocusChanged(QWaylandWindow *newFocus, QWaylandWindow *oldFocus) { + if (newFocus) + m_display->handleWindowActivated(newFocus); + if (oldFocus) + m_display->handleWindowDeactivated(oldFocus); + } + +protected: + QWaylandDisplay *m_display; }; } diff --git a/src/plugins/shellintegration/ivi-shell/qwaylandivishellintegration.cpp b/src/plugins/shellintegration/ivi-shell/qwaylandivishellintegration.cpp index 6876385b..6103e6be 100644 --- a/src/plugins/shellintegration/ivi-shell/qwaylandivishellintegration.cpp +++ b/src/plugins/shellintegration/ivi-shell/qwaylandivishellintegration.cpp @@ -66,6 +66,7 @@ QWaylandIviShellIntegration::~QWaylandIviShellIntegration() bool QWaylandIviShellIntegration::initialize(QWaylandDisplay *display) { + QWaylandShellIntegration::initialize(display); display->addRegistryListener(registryIvi, this); return true; -- cgit v1.2.1 From 99c3d12f1a4ac152a80f4ad97a6cee5a0e8bb370 Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Fri, 11 Nov 2016 08:59:39 +0100 Subject: Remove useless method QWaylandShmBackingStore::hidden Change-Id: I8e28d3c1dc2c2bbff4517ffe3b2f63c2ac86b95f Reviewed-by: Jan Arne Petersen Reviewed-by: Paul Olav Tvete --- src/client/qwaylandshmbackingstore.cpp | 4 ---- src/client/qwaylandshmbackingstore_p.h | 1 - src/client/qwaylandwindow.cpp | 3 --- 3 files changed, 8 deletions(-) diff --git a/src/client/qwaylandshmbackingstore.cpp b/src/client/qwaylandshmbackingstore.cpp index 13f823ed..5f8336c1 100644 --- a/src/client/qwaylandshmbackingstore.cpp +++ b/src/client/qwaylandshmbackingstore.cpp @@ -185,10 +185,6 @@ void QWaylandShmBackingStore::endPaint() waylandWindow()->setCanResize(true); } -void QWaylandShmBackingStore::hidden() -{ -} - void QWaylandShmBackingStore::ensureSize() { waylandWindow()->setBackingStore(this); diff --git a/src/client/qwaylandshmbackingstore_p.h b/src/client/qwaylandshmbackingstore_p.h index c3e76350..5068519d 100644 --- a/src/client/qwaylandshmbackingstore_p.h +++ b/src/client/qwaylandshmbackingstore_p.h @@ -96,7 +96,6 @@ public: void resize(const QSize &size); void beginPaint(const QRegion &) Q_DECL_OVERRIDE; void endPaint() Q_DECL_OVERRIDE; - void hidden(); QWaylandAbstractDecoration *windowDecoration() const; diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp index e72ed770..6c3647d8 100644 --- a/src/client/qwaylandwindow.cpp +++ b/src/client/qwaylandwindow.cpp @@ -341,9 +341,6 @@ void QWaylandWindow::setVisible(bool visible) if (!deleteGuard.isNull()) { attach(static_cast(0), 0, 0); commit(); - if (mBackingStore) { - mBackingStore->hidden(); - } } } } -- cgit v1.2.1 From 928c10b702b9fa73e3ccd185fa9ef1c4580e7409 Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Fri, 11 Nov 2016 14:22:16 +0100 Subject: Compositor: Set view output in QWaylandQuickItem::init() This fixes a crash when the constructor of QWaylandXdgPopupV5Integration tries to access the output scale factor. Change-Id: I3cafee7a47b18e1025044b35d4578c7a6258eee4 Reviewed-by: Pier Luigi Fiorini Reviewed-by: Paul Olav Tvete --- src/compositor/compositor_api/qwaylandquickitem.cpp | 7 ++++++- src/compositor/compositor_api/qwaylandquickitem_p.h | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/compositor/compositor_api/qwaylandquickitem.cpp b/src/compositor/compositor_api/qwaylandquickitem.cpp index e6cfce34..d57cbb42 100644 --- a/src/compositor/compositor_api/qwaylandquickitem.cpp +++ b/src/compositor/compositor_api/qwaylandquickitem.cpp @@ -1074,11 +1074,16 @@ void QWaylandQuickItem::updateBuffer(bool hasBuffer) void QWaylandQuickItem::updateWindow() { Q_D(QWaylandQuickItem); + + QQuickWindow *newWindow = window(); + if (newWindow == d->connectedWindow) + return; + if (d->connectedWindow) { disconnect(d->connectedWindow, &QQuickWindow::beforeSynchronizing, this, &QWaylandQuickItem::beforeSync); } - d->connectedWindow = window(); + d->connectedWindow = newWindow; if (d->connectedWindow) { connect(d->connectedWindow, &QQuickWindow::beforeSynchronizing, this, &QWaylandQuickItem::beforeSync, Qt::DirectConnection); diff --git a/src/compositor/compositor_api/qwaylandquickitem_p.h b/src/compositor/compositor_api/qwaylandquickitem_p.h index 5eba9957..441ac976 100644 --- a/src/compositor/compositor_api/qwaylandquickitem_p.h +++ b/src/compositor/compositor_api/qwaylandquickitem_p.h @@ -142,6 +142,8 @@ public: QObject::connect(view.data(), &QWaylandView::outputChanged, q, &QWaylandQuickItem::outputChanged); QObject::connect(view.data(), &QWaylandView::bufferLockedChanged, q, &QWaylandQuickItem::bufferLockedChanged); QObject::connect(view.data(), &QWaylandView::allowDiscardFrontBufferChanged, q, &QWaylandQuickItem::allowDiscardFrontBuffer); + + q->updateWindow(); } void setInputEventsEnabled(bool enable) -- cgit v1.2.1 From 93b691636dc78bc67805d0ae45b0a3ada79990b3 Mon Sep 17 00:00:00 2001 From: Pier Luigi Fiorini Date: Sat, 29 Oct 2016 19:43:49 +0200 Subject: Add a QML client manual test This little program can be useful to test window states in clients and compositors. Change-Id: I8eadc0d83906805a909032fb9341037491f6d379 Reviewed-by: Giulio Camuffo --- tests/manual/qmlclient/main.cpp | 51 +++++++++++++++++ tests/manual/qmlclient/main.qml | 105 +++++++++++++++++++++++++++++++++++ tests/manual/qmlclient/qml.qrc | 5 ++ tests/manual/qmlclient/qmlclient.pro | 12 ++++ 4 files changed, 173 insertions(+) create mode 100644 tests/manual/qmlclient/main.cpp create mode 100644 tests/manual/qmlclient/main.qml create mode 100644 tests/manual/qmlclient/qml.qrc create mode 100644 tests/manual/qmlclient/qmlclient.pro diff --git a/tests/manual/qmlclient/main.cpp b/tests/manual/qmlclient/main.cpp new file mode 100644 index 00000000..cb2044c2 --- /dev/null +++ b/tests/manual/qmlclient/main.cpp @@ -0,0 +1,51 @@ +/**************************************************************************** +** +** Copyright (C) 2016 Pier Luigi Fiorini +** Contact: http://www.qt-project.org/legal +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include + +int main(int argc, char* argv[]) +{ + setenv("QT_QPA_PLATFORM", "wayland", 1); + + QGuiApplication app(argc, argv); + QQmlApplicationEngine engine(QUrl("qrc:/main.qml")); + return app.exec(); +} diff --git a/tests/manual/qmlclient/main.qml b/tests/manual/qmlclient/main.qml new file mode 100644 index 00000000..a1fe241c --- /dev/null +++ b/tests/manual/qmlclient/main.qml @@ -0,0 +1,105 @@ +/**************************************************************************** +** +** Copyright (C) 2016 Pier Luigi Fiorini +** Contact: http://www.qt-project.org/legal +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.2 +import QtQuick.Window 2.2 + +Window { + id: window + width: 400 + height: 400 + color: "blue" + visible: true + + Column { + spacing: 8 + + Row { + spacing: 8 + + Repeater { + model: ListModel { + ListElement { label: "Windowed"; value: Window.Windowed } + ListElement { label: "Maximized"; value: Window.Maximized } + ListElement { label: "FullScreen"; value: Window.FullScreen } + } + + Rectangle { + width: 96 + height: 40 + color: "gainsboro" + + MouseArea { + anchors.fill: parent + onClicked: window.visibility = model.value + + Text { + anchors.centerIn: parent + text: model.label + } + } + } + } + } + + Text { + color: "white" + text: { + switch (window.visibility) { + case Window.Windowed: + return "windowed"; + case Window.Maximized: + return "maximized"; + case Window.FullScreen: + return "fullscreen"; + case Window.Minimized: + return "minimized"; + case Window.AutomaticVisibility: + return "automatic"; + case Window.Hidden: + return "hidden"; + default: + break; + } + return "unknown"; + } + } + } +} diff --git a/tests/manual/qmlclient/qml.qrc b/tests/manual/qmlclient/qml.qrc new file mode 100644 index 00000000..6b2d0a78 --- /dev/null +++ b/tests/manual/qmlclient/qml.qrc @@ -0,0 +1,5 @@ + + + main.qml + + diff --git a/tests/manual/qmlclient/qmlclient.pro b/tests/manual/qmlclient/qmlclient.pro new file mode 100644 index 00000000..dcf66db5 --- /dev/null +++ b/tests/manual/qmlclient/qmlclient.pro @@ -0,0 +1,12 @@ +TEMPLATE = app + +QT += \ + gui gui-private core-private \ + quick \ + waylandclient \ + +SOURCES += \ + main.cpp + +RESOURCES += \ + qml.qrc -- cgit v1.2.1 From 3c915ab6b18c4fd7f53726197cf39d83551e18a6 Mon Sep 17 00:00:00 2001 From: Robert Loehning Date: Mon, 14 Nov 2016 15:29:48 +0100 Subject: Add missing override to initialize in QWaylandIviSurface Change-Id: I341a8969bcdf31a84e29778312e249277797e510 Reviewed-by: Johan Helsing --- src/compositor/extensions/qwaylandivisurface.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compositor/extensions/qwaylandivisurface.h b/src/compositor/extensions/qwaylandivisurface.h index 37c37c0f..ec536507 100644 --- a/src/compositor/extensions/qwaylandivisurface.h +++ b/src/compositor/extensions/qwaylandivisurface.h @@ -81,7 +81,7 @@ Q_SIGNALS: void iviIdChanged(); private: - void initialize(); + void initialize() Q_DECL_OVERRIDE; }; QT_END_NAMESPACE -- cgit v1.2.1 From 24542e10ca4867b437ef4bdc46153888ce6d6d50 Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Tue, 15 Nov 2016 13:24:46 +0100 Subject: Declare QWaylandOutputMode as a movable type Based on API review comment from Lars. Change-Id: Id48a24218a3bce18d002fc4555b3c332b4b0fa49 Reviewed-by: Johan Helsing --- src/compositor/compositor_api/qwaylandoutputmode.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/compositor/compositor_api/qwaylandoutputmode.h b/src/compositor/compositor_api/qwaylandoutputmode.h index 4ef57f2e..aa44be92 100644 --- a/src/compositor/compositor_api/qwaylandoutputmode.h +++ b/src/compositor/compositor_api/qwaylandoutputmode.h @@ -66,6 +66,7 @@ private: void setWidth(int width); void setHeight(int height); }; +Q_DECLARE_TYPEINFO(QWaylandOutputMode, Q_MOVABLE_TYPE); QT_END_NAMESPACE -- cgit v1.2.1 From 7c3c32ecc62dfdb701daafc3f800767ff1eb9040 Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Mon, 14 Nov 2016 11:59:16 +0100 Subject: Fade-out animation for menus Since child items don't get transformation animations, enable an opacity transformation for them. Change-Id: I4ab77bc10d61602a0df72f5927cde4ebbcad27ce Reviewed-by: Johan Helsing --- examples/wayland/pure-qml/qml/Chrome.qml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/examples/wayland/pure-qml/qml/Chrome.qml b/examples/wayland/pure-qml/qml/Chrome.qml index d2ff5cc2..dc3ad473 100644 --- a/examples/wayland/pure-qml/qml/Chrome.qml +++ b/examples/wayland/pure-qml/qml/Chrome.qml @@ -44,6 +44,8 @@ import QtWayland.Compositor 1.0 ShellSurfaceItem { id: rootChrome + property bool isChild: parent.shellSurface !== undefined + onSurfaceDestroyed: { bufferLocked = true; destroyAnimation.start(); @@ -67,6 +69,7 @@ ShellSurfaceItem { ParallelAnimation { NumberAnimation { target: scaleTransform; property: "yScale"; to: 2/height; duration: 150 } NumberAnimation { target: scaleTransform; property: "xScale"; to: 0.4; duration: 150 } + NumberAnimation { target: rootChrome; property: "opacity"; to: rootChrome.isChild ? 0 : 1; duration: 150 } } NumberAnimation { target: scaleTransform; property: "xScale"; to: 0; duration: 150 } ScriptAction { script: { rootChrome.destroy(); } } -- cgit v1.2.1 From 5994c093e430161155d77be3af1ab4128a3fb54e Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Wed, 16 Nov 2016 13:56:23 +0100 Subject: Rename qwaylandxdgpopup_p.cpp to qwaylandxdgpopup.cpp Change-Id: I4bffaafdae07db96d4fcca7d2a0751941a2e635f Reviewed-by: Pier Luigi Fiorini --- src/client/client.pro | 2 +- src/client/qwaylandxdgpopup.cpp | 61 +++++++++++++++++++++++++++++++++++++++ src/client/qwaylandxdgpopup_p.cpp | 61 --------------------------------------- 3 files changed, 62 insertions(+), 62 deletions(-) create mode 100644 src/client/qwaylandxdgpopup.cpp delete mode 100644 src/client/qwaylandxdgpopup_p.cpp diff --git a/src/client/client.pro b/src/client/client.pro index 34955dfb..5ae01c04 100644 --- a/src/client/client.pro +++ b/src/client/client.pro @@ -66,7 +66,7 @@ SOURCES += qwaylandintegration.cpp \ qwaylandwlshellintegration.cpp \ qwaylandxdgshell.cpp \ qwaylandxdgsurface.cpp \ - qwaylandxdgpopup_p.cpp \ + qwaylandxdgpopup.cpp \ qwaylandxdgshellintegration.cpp \ qwaylandextendedsurface.cpp \ qwaylandsubsurface.cpp \ diff --git a/src/client/qwaylandxdgpopup.cpp b/src/client/qwaylandxdgpopup.cpp new file mode 100644 index 00000000..abc25278 --- /dev/null +++ b/src/client/qwaylandxdgpopup.cpp @@ -0,0 +1,61 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL21$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qwaylandxdgpopup_p.h" + +#include "qwaylandwindow_p.h" +#include "qwaylanddisplay_p.h" +#include "qwaylandextendedsurface_p.h" + +QT_BEGIN_NAMESPACE + +namespace QtWaylandClient { + +QWaylandXdgPopup::QWaylandXdgPopup(struct ::xdg_popup *popup, QWaylandWindow *window) + : QWaylandShellSurface(window) + , QtWayland::xdg_popup(popup) + , m_extendedWindow(nullptr) +{ + if (window->display()->windowExtension()) + m_extendedWindow = new QWaylandExtendedSurface(window); +} + +QWaylandXdgPopup::~QWaylandXdgPopup() +{ + xdg_popup_destroy(object()); + delete m_extendedWindow; +} + +} + +QT_END_NAMESPACE diff --git a/src/client/qwaylandxdgpopup_p.cpp b/src/client/qwaylandxdgpopup_p.cpp deleted file mode 100644 index abc25278..00000000 --- a/src/client/qwaylandxdgpopup_p.cpp +++ /dev/null @@ -1,61 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL21$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qwaylandxdgpopup_p.h" - -#include "qwaylandwindow_p.h" -#include "qwaylanddisplay_p.h" -#include "qwaylandextendedsurface_p.h" - -QT_BEGIN_NAMESPACE - -namespace QtWaylandClient { - -QWaylandXdgPopup::QWaylandXdgPopup(struct ::xdg_popup *popup, QWaylandWindow *window) - : QWaylandShellSurface(window) - , QtWayland::xdg_popup(popup) - , m_extendedWindow(nullptr) -{ - if (window->display()->windowExtension()) - m_extendedWindow = new QWaylandExtendedSurface(window); -} - -QWaylandXdgPopup::~QWaylandXdgPopup() -{ - xdg_popup_destroy(object()); - delete m_extendedWindow; -} - -} - -QT_END_NAMESPACE -- cgit v1.2.1 From a8a7e28708a5c0741c013247cd3f3dc985d0fb57 Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Wed, 16 Nov 2016 14:45:43 +0100 Subject: Fix crash with nested xdg popups Popups that are children of popups would get a null parent in pure-qml. This would cause a crash in XdgPopupV5Integration. This change fixes pure-qml to set the parent correctly, and also adds null pointer checks to XdgPopupV5Integration. Change-Id: Ica5bd6c1a0853fbec1b30bc6ffff806b2cfd15f8 Reviewed-by: Johan Helsing --- examples/wayland/pure-qml/qml/main.qml | 3 ++- src/compositor/extensions/qwaylandxdgshellv5integration.cpp | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/examples/wayland/pure-qml/qml/main.qml b/examples/wayland/pure-qml/qml/main.qml index 9bce7bcb..5eece078 100644 --- a/examples/wayland/pure-qml/qml/main.qml +++ b/examples/wayland/pure-qml/qml/main.qml @@ -81,7 +81,8 @@ WaylandCompositor { } onXdgPopupCreated: { var parentView = viewsBySurface[xdgPopup.parentSurface]; - chromeComponent.createObject(parentView, { "shellSurface": xdgPopup } ); + var item = chromeComponent.createObject(parentView, { "shellSurface": xdgPopup } ); + viewsBySurface[xdgPopup.surface] = item; } } diff --git a/src/compositor/extensions/qwaylandxdgshellv5integration.cpp b/src/compositor/extensions/qwaylandxdgshellv5integration.cpp index b3170333..e2aa6b3e 100644 --- a/src/compositor/extensions/qwaylandxdgshellv5integration.cpp +++ b/src/compositor/extensions/qwaylandxdgshellv5integration.cpp @@ -194,10 +194,14 @@ XdgPopupV5Integration::XdgPopupV5Integration(QWaylandQuickShellSurfaceItem *item , m_xdgShell(QWaylandXdgPopupV5Private::get(m_xdgPopup)->m_xdgShell) { item->setSurface(m_xdgPopup->surface()); - item->moveItem()->setPosition(QPointF(m_xdgPopup->position() * item->view()->output()->scaleFactor())); + if (item->view()->output()) + item->moveItem()->setPosition(QPointF(m_xdgPopup->position() * item->view()->output()->scaleFactor())); + else + qWarning() << "XdgPopupV5Integration popup item without output" << item; QWaylandClient *client = m_xdgPopup->surface()->client(); - QWaylandQuickShellEventFilter::startFilter(client, [&]() { m_xdgShell->closeAllPopups(); }); + auto shell = m_xdgShell; + QWaylandQuickShellEventFilter::startFilter(client, [shell]() { shell->closeAllPopups(); }); connect(m_xdgPopup, &QWaylandXdgPopupV5::destroyed, this, &XdgPopupV5Integration::handlePopupDestroyed); } -- cgit v1.2.1 From 12f2e1e23fc1de16a42d3024561c0f839f9e96cd Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Wed, 16 Nov 2016 09:37:51 +0100 Subject: Don't crash when surface is destroyed Change-Id: I082c3bb0003265c625d165e1463951842a730c11 Reviewed-by: Johan Helsing --- .../extensions/qwaylandquickshellsurfaceitem.cpp | 2 +- src/compositor/extensions/qwaylandwlshell.cpp | 6 +++--- src/compositor/extensions/qwaylandwlshell_p.h | 2 +- .../extensions/qwaylandwlshellintegration.cpp | 21 +++++++++++---------- .../extensions/qwaylandwlshellintegration_p.h | 2 +- 5 files changed, 17 insertions(+), 16 deletions(-) diff --git a/src/compositor/extensions/qwaylandquickshellsurfaceitem.cpp b/src/compositor/extensions/qwaylandquickshellsurfaceitem.cpp index f6a88e43..91f9d777 100644 --- a/src/compositor/extensions/qwaylandquickshellsurfaceitem.cpp +++ b/src/compositor/extensions/qwaylandquickshellsurfaceitem.cpp @@ -208,7 +208,7 @@ bool QWaylandQuickShellEventFilter::eventFilter(QObject *receiver, QEvent *e) QMouseEvent *event = static_cast(e); QWaylandQuickShellSurfaceItem *shellSurfaceItem = qobject_cast(item); bool finalRelease = (event->type() == QEvent::MouseButtonRelease) && (event->buttons() == Qt::NoButton); - bool popupClient = shellSurfaceItem && shellSurfaceItem->surface()->client() == client; + bool popupClient = shellSurfaceItem && shellSurfaceItem->surface() && shellSurfaceItem->surface()->client() == client; if (waitForRelease) { // We are eating events until all mouse buttons are released diff --git a/src/compositor/extensions/qwaylandwlshell.cpp b/src/compositor/extensions/qwaylandwlshell.cpp index 3145c664..9b434679 100644 --- a/src/compositor/extensions/qwaylandwlshell.cpp +++ b/src/compositor/extensions/qwaylandwlshell.cpp @@ -335,7 +335,7 @@ QList QWaylandWlShell::shellSurfacesForClient(QWayland Q_D(const QWaylandWlShell); QList surfsForClient; Q_FOREACH (QWaylandWlShellSurface *shellSurface, d->m_shellSurfaces) { - if (shellSurface->surface()->client() == client) + if (shellSurface->surface() && shellSurface->surface()->client() == client) surfsForClient.append(shellSurface); } return surfsForClient; @@ -347,7 +347,7 @@ QList QWaylandWlShell::mappedPopups() const QList popupSurfaces; Q_FOREACH (QWaylandWlShellSurface *shellSurface, d->m_shellSurfaces) { if (shellSurface->windowType() == Qt::WindowType::Popup - && shellSurface->surface()->hasContent()) { + && shellSurface->surface() && shellSurface->surface()->hasContent()) { popupSurfaces.append(shellSurface); } } @@ -359,7 +359,7 @@ QWaylandClient *QWaylandWlShell::popupClient() const Q_D(const QWaylandWlShell); Q_FOREACH (QWaylandWlShellSurface *shellSurface, d->m_shellSurfaces) { if (shellSurface->windowType() == Qt::WindowType::Popup - && shellSurface->surface()->hasContent()) { + && shellSurface->surface() && shellSurface->surface()->hasContent()) { return shellSurface->surface()->client(); } } diff --git a/src/compositor/extensions/qwaylandwlshell_p.h b/src/compositor/extensions/qwaylandwlshell_p.h index 5e890309..a087f6f7 100644 --- a/src/compositor/extensions/qwaylandwlshell_p.h +++ b/src/compositor/extensions/qwaylandwlshell_p.h @@ -98,7 +98,7 @@ public: private: QWaylandWlShell *m_shell; - QWaylandSurface *m_surface; + QPointer m_surface; QSet m_pings; diff --git a/src/compositor/extensions/qwaylandwlshellintegration.cpp b/src/compositor/extensions/qwaylandwlshellintegration.cpp index 30e4704a..761a9022 100644 --- a/src/compositor/extensions/qwaylandwlshellintegration.cpp +++ b/src/compositor/extensions/qwaylandwlshellintegration.cpp @@ -55,17 +55,17 @@ WlShellIntegration::WlShellIntegration(QWaylandQuickShellSurfaceItem *item) , nextState(State::Windowed) { m_item->setSurface(m_shellSurface->surface()); - connect(m_shellSurface, &QWaylandWlShellSurface::startMove, this, &WlShellIntegration::handleStartMove); - connect(m_shellSurface, &QWaylandWlShellSurface::startResize, this, &WlShellIntegration::handleStartResize); + connect(m_shellSurface.data(), &QWaylandWlShellSurface::startMove, this, &WlShellIntegration::handleStartMove); + connect(m_shellSurface.data(), &QWaylandWlShellSurface::startResize, this, &WlShellIntegration::handleStartResize); connect(m_shellSurface->surface(), &QWaylandSurface::redraw, this, &WlShellIntegration::handleRedraw); connect(m_shellSurface->surface(), &QWaylandSurface::offsetForNextFrame, this, &WlShellIntegration::adjustOffsetForNextFrame); connect(m_shellSurface->surface(), &QWaylandSurface::hasContentChanged, this, &WlShellIntegration::handleSurfaceHasContentChanged); - connect(m_shellSurface, &QWaylandWlShellSurface::setDefaultToplevel, this, &WlShellIntegration::handleSetDefaultTopLevel); - connect(m_shellSurface, &QWaylandWlShellSurface::setTransient, this, &WlShellIntegration::handleSetTransient); - connect(m_shellSurface, &QWaylandWlShellSurface::setMaximized, this, &WlShellIntegration::handleSetMaximized); - connect(m_shellSurface, &QWaylandWlShellSurface::setFullScreen, this, &WlShellIntegration::handleSetFullScreen); - connect(m_shellSurface, &QWaylandWlShellSurface::setPopup, this, &WlShellIntegration::handleSetPopup); - connect(m_shellSurface, &QWaylandWlShellSurface::destroyed, this, &WlShellIntegration::handleShellSurfaceDestroyed); + connect(m_shellSurface.data(), &QWaylandWlShellSurface::setDefaultToplevel, this, &WlShellIntegration::handleSetDefaultTopLevel); + connect(m_shellSurface.data(), &QWaylandWlShellSurface::setTransient, this, &WlShellIntegration::handleSetTransient); + connect(m_shellSurface.data(), &QWaylandWlShellSurface::setMaximized, this, &WlShellIntegration::handleSetMaximized); + connect(m_shellSurface.data(), &QWaylandWlShellSurface::setFullScreen, this, &WlShellIntegration::handleSetFullScreen); + connect(m_shellSurface.data(), &QWaylandWlShellSurface::setPopup, this, &WlShellIntegration::handleSetPopup); + connect(m_shellSurface.data(), &QWaylandWlShellSurface::destroyed, this, &WlShellIntegration::handleShellSurfaceDestroyed); } void WlShellIntegration::handleStartMove(QWaylandSeat *seat) @@ -182,8 +182,9 @@ void WlShellIntegration::handleSetPopup(QWaylandSeat *seat, QWaylandSurface *par } isPopup = true; - QWaylandQuickShellEventFilter::startFilter(m_shellSurface->surface()->client(), [&]() { - m_shellSurface->shell()->closeAllPopups(); + auto shell = m_shellSurface->shell(); + QWaylandQuickShellEventFilter::startFilter(m_shellSurface->surface()->client(), [shell]() { + shell->closeAllPopups(); }); QObject::connect(m_shellSurface->surface(), &QWaylandSurface::hasContentChanged, diff --git a/src/compositor/extensions/qwaylandwlshellintegration_p.h b/src/compositor/extensions/qwaylandwlshellintegration_p.h index bbdfbd73..c0bbcfd1 100644 --- a/src/compositor/extensions/qwaylandwlshellintegration_p.h +++ b/src/compositor/extensions/qwaylandwlshellintegration_p.h @@ -88,7 +88,7 @@ private: void handlePopupRemoved(); QWaylandQuickShellSurfaceItem *m_item; - QWaylandWlShellSurface *m_shellSurface; + QPointer m_shellSurface; GrabberState grabberState; struct { QWaylandSeat *seat; -- cgit v1.2.1 From 5b807802866c8df00cb3340d4f9bcc343be5973a Mon Sep 17 00:00:00 2001 From: Giulio Camuffo Date: Sat, 2 Jul 2016 10:46:58 +0200 Subject: Create and destroy the shell surface when showing and hiding This changes the shell surface handling for windows, and instead of creating the shell surface at initialization time, and then attaching a null buffer to hide it, it creates the shell surface on setVisible(true), and destroys it on setVisible(false). This fixes hiding when using xdg_shell, as that interface defines that attaching a null buffer to an xdg_surface is an error. Also this should help with bugged EGL drivers which attach a buffer after eglSwapBuffers() returns, which used to cause a newly hidden window to get a new valid buffer after we attached a null one, showing it again. Task-number: QTBUG-47902 Change-Id: I8e0a0442319a98cc1361803ea7be1d079b36fc8c Reviewed-by: Johan Helsing Reviewed-by: Paul Olav Tvete --- src/client/qwaylandshellsurface_p.h | 5 +- src/client/qwaylandshmbackingstore.cpp | 8 +- src/client/qwaylandwindow.cpp | 90 +++++++++++----------- src/client/qwaylandwindow_p.h | 2 + src/client/qwaylandwlshellsurface.cpp | 10 +++ src/client/qwaylandwlshellsurface_p.h | 6 +- src/client/qwaylandxdgpopup.cpp | 6 ++ src/client/qwaylandxdgpopup_p.h | 2 + src/client/qwaylandxdgsurface.cpp | 19 ++--- src/client/qwaylandxdgsurface_p.h | 5 +- .../client/wayland-egl/qwaylandeglwindow.cpp | 10 +++ .../client/wayland-egl/qwaylandeglwindow.h | 4 + .../qwaylandxcompositeeglcontext.cpp | 4 +- .../qwaylandxcompositeglxcontext.cpp | 4 +- .../ivi-shell/qwaylandivisurface.cpp | 7 ++ .../ivi-shell/qwaylandivisurface_p.h | 2 + tests/auto/client/client/tst_client.cpp | 4 +- 17 files changed, 110 insertions(+), 78 deletions(-) diff --git a/src/client/qwaylandshellsurface_p.h b/src/client/qwaylandshellsurface_p.h index 63b77ab3..b51c252f 100644 --- a/src/client/qwaylandshellsurface_p.h +++ b/src/client/qwaylandshellsurface_p.h @@ -94,15 +94,14 @@ public: inline QWaylandWindow *window() { return m_window; } + virtual void setType(Qt::WindowType type, QWaylandWindow *transientParent) = 0; + protected: virtual void setMaximized() {} virtual void setFullscreen() {} virtual void setNormal() {} virtual void setMinimized() {} - virtual void setTopLevel() {} - virtual void updateTransientParent(QWindow * /*parent*/) {} - private: QWaylandWindow *m_window; friend class QWaylandWindow; diff --git a/src/client/qwaylandshmbackingstore.cpp b/src/client/qwaylandshmbackingstore.cpp index 5f8336c1..d0d6cfd3 100644 --- a/src/client/qwaylandshmbackingstore.cpp +++ b/src/client/qwaylandshmbackingstore.cpp @@ -211,13 +211,7 @@ void QWaylandShmBackingStore::flush(QWindow *window, const QRegion ®ion, cons QMargins margins = windowDecorationMargins(); - waylandWindow()->attachOffset(mFrontBuffer); - mFrontBuffer->setBusy(); - - QVector rects = region.rects(); - foreach (const QRect &rect, rects) - waylandWindow()->damage(rect.translated(margins.left(), margins.top())); - waylandWindow()->commit(); + waylandWindow()->commit(mFrontBuffer, region.translated(margins.left(), margins.top())); } void QWaylandShmBackingStore::resize(const QSize &size, const QRegion &) diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp index 6c3647d8..1ff6686f 100644 --- a/src/client/qwaylandwindow.cpp +++ b/src/client/qwaylandwindow.cpp @@ -96,8 +96,6 @@ QWaylandWindow::QWaylandWindow(QWindow *window) { static WId id = 1; mWindowId = id++; - if (window->type() != Qt::Desktop) - initWindow(); } QWaylandWindow::~QWaylandWindow() @@ -126,18 +124,28 @@ QWaylandWindow::~QWaylandWindow() void QWaylandWindow::initWindow() { - init(mDisplay->createSurface(static_cast(this))); + if (window()->type() == Qt::Desktop) + return; + + if (!isInitialized()) + init(mDisplay->createSurface(static_cast(this))); if (shouldCreateSubSurface()) { + Q_ASSERT(!mSubSurfaceWindow); + QWaylandWindow *p = static_cast(QPlatformWindow::parent()); if (::wl_subsurface *ss = mDisplay->createSubSurface(this, p)) { mSubSurfaceWindow = new QWaylandSubSurface(this, p, ss); } } else if (shouldCreateShellSurface()) { + Q_ASSERT(!mShellSurface); + mShellSurface = mDisplay->createShellSurface(this); - } + if (!mShellSurface) + qFatal("Could not create a shell surface object."); + + mShellSurface->setType(window()->type(), transientParent()); - if (mShellSurface) { // Set initial surface title setWindowTitle(window()->title()); @@ -171,17 +179,6 @@ void QWaylandWindow::initWindow() } } - if (mShellSurface) { - if (window()->transientParent()) { - if (window()->type() != Qt::Popup) { - mShellSurface->updateTransientParent(window()->transientParent()); - } - } else { - if (window()->type() != Qt::ToolTip) - mShellSurface->setTopLevel(); - } - } - // Enable high-dpi rendering. Scale() returns the screen scale factor and will // typically be integer 1 (normal-dpi) or 2 (high-dpi). Call set_buffer_scale() // to inform the compositor that high-resolution buffers will be provided. @@ -244,6 +241,9 @@ WId QWaylandWindow::winId() const void QWaylandWindow::setParent(const QPlatformWindow *parent) { + if (!window()->isVisible()) + return; + QWaylandWindow *oldparent = mSubSurfaceWindow ? mSubSurfaceWindow->parent() : 0; if (oldparent == parent) return; @@ -287,8 +287,7 @@ void QWaylandWindow::setGeometry_helper(const QRect &rect) 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()); + } } void QWaylandWindow::setGeometry(const QRect &rect) @@ -313,20 +312,8 @@ void QWaylandWindow::setGeometry(const QRect &rect) void QWaylandWindow::setVisible(bool visible) { if (visible) { - if (mShellSurface) { - if (window()->type() == Qt::Popup) { - QWaylandWindow *parent = transientParent(); - if (parent) { - QWaylandWlShellSurface *wlshellSurface = qobject_cast(mShellSurface); - if (wlshellSurface) - wlshellSurface->setPopup(parent, mDisplay->lastInputDevice(), mDisplay->lastInputSerial()); - } - } else if (window()->type() == Qt::ToolTip) { - if (QWaylandWindow *parent = transientParent()) { - mShellSurface->updateTransientParent(parent->window()); - } - } - } + initWindow(); + mDisplay->flushRequests(); setGeometry(window()->geometry()); // Don't flush the events here, or else the newly visible window may start drawing, but since @@ -338,10 +325,8 @@ void QWaylandWindow::setVisible(bool visible) // case 'this' will be deleted. When that happens, we must abort right away. QPointer deleteGuard(this); QWindowSystemInterface::flushWindowSystemEvents(); - if (!deleteGuard.isNull()) { - attach(static_cast(0), 0, 0); - commit(); - } + if (!deleteGuard.isNull()) + reset(); } } @@ -374,7 +359,7 @@ void QWaylandWindow::setMask(const QRegion &mask) wl_region_destroy(region); } - commit(); + wl_surface::commit(); } void QWaylandWindow::configure(uint32_t edges, int32_t width, int32_t height) @@ -461,6 +446,7 @@ void QWaylandWindow::attach(QWaylandBuffer *buffer, int x, int y) wl_callback_add_listener(callback, &QWaylandWindow::callbackListener, this); mFrameCallback = callback; mWaitingForFrameSync = true; + buffer->setBusy(); attach(buffer->buffer(), x, y); } else { @@ -479,6 +465,18 @@ void QWaylandWindow::damage(const QRect &rect) damage(rect.x(), rect.y(), rect.width(), rect.height()); } +void QWaylandWindow::commit(QWaylandBuffer *buffer, const QRegion &damage) +{ + if (!isInitialized()) + return; + + attachOffset(buffer); + const QVector rects = damage.rects(); + for (const QRect &rect: rects) + wl_surface::damage(rect.x(), rect.y(), rect.width(), rect.height()); + wl_surface::commit(); +} + const wl_callback_listener QWaylandWindow::callbackListener = { QWaylandWindow::frameCallback }; @@ -555,7 +553,7 @@ void QWaylandWindow::handleContentOrientationChange(Qt::ScreenOrientation orient } set_buffer_transform(transform); // set_buffer_transform is double buffered, we need to commit. - commit(); + wl_surface::commit(); } void QWaylandWindow::setOrientationMask(Qt::ScreenOrientations mask) @@ -681,15 +679,13 @@ static QWindow *topLevelWindow(QWindow *window) QWaylandWindow *QWaylandWindow::transientParent() const { - if (window()->transientParent()) { - // Take the top level window here, since the transient parent may be a QWidgetWindow - // or some other window without a shell surface, which is then not able to get mouse - // events. - return static_cast(topLevelWindow(window()->transientParent())->handle()); - } - // Try with the current focus window. It should be the right one and anyway - // better than having no parent at all. - return mDisplay->lastInputWindow(); + // Take the top level window here, since the transient parent may be a QWidgetWindow + // or some other window without a shell surface, which is then not able to get mouse + // events. + if (auto transientParent = window()->transientParent()) + return static_cast(topLevelWindow(transientParent)->handle()); + + return nullptr; } void QWaylandWindow::handleMouse(QWaylandInputDevice *inputDevice, const QWaylandPointerEvent &e) diff --git a/src/client/qwaylandwindow_p.h b/src/client/qwaylandwindow_p.h index 442fe9ad..7e7078fc 100644 --- a/src/client/qwaylandwindow_p.h +++ b/src/client/qwaylandwindow_p.h @@ -132,6 +132,8 @@ public: using QtWayland::wl_surface::damage; void damage(const QRect &rect); + void commit(QWaylandBuffer *buffer, const QRegion &damage); + void waitForFrameSync(); QMargins frameMargins() const Q_DECL_OVERRIDE; diff --git a/src/client/qwaylandwlshellsurface.cpp b/src/client/qwaylandwlshellsurface.cpp index 3527015c..77434e98 100644 --- a/src/client/qwaylandwlshellsurface.cpp +++ b/src/client/qwaylandwlshellsurface.cpp @@ -215,6 +215,16 @@ void QWaylandWlShellSurface::setPopup(QWaylandWindow *parent, QWaylandInputDevic transientPos.x(), transientPos.y(), 0); } +void QWaylandWlShellSurface::setType(Qt::WindowType type, QWaylandWindow *transientParent) +{ + if (type == Qt::Popup && transientParent) + setPopup(transientParent, m_window->display()->lastInputDevice(), m_window->display()->lastInputSerial()); + else if (transientParent) + updateTransientParent(transientParent->window()); + else + setTopLevel(); +} + void QWaylandWlShellSurface::shell_surface_ping(uint32_t serial) { pong(serial); diff --git a/src/client/qwaylandwlshellsurface_p.h b/src/client/qwaylandwlshellsurface_p.h index ef732ef8..af86276b 100644 --- a/src/client/qwaylandwlshellsurface_p.h +++ b/src/client/qwaylandwlshellsurface_p.h @@ -92,14 +92,16 @@ public: void setWindowFlags(Qt::WindowFlags flags) Q_DECL_OVERRIDE; void sendProperty(const QString &name, const QVariant &value) Q_DECL_OVERRIDE; + void setType(Qt::WindowType type, QWaylandWindow *transientParent) override; + private: void setMaximized() Q_DECL_OVERRIDE; void setFullscreen() Q_DECL_OVERRIDE; void setNormal() Q_DECL_OVERRIDE; void setMinimized() Q_DECL_OVERRIDE; - void setTopLevel() Q_DECL_OVERRIDE; - void updateTransientParent(QWindow *parent) Q_DECL_OVERRIDE; + void setTopLevel(); + void updateTransientParent(QWindow *parent); void setPopup(QWaylandWindow *parent, QWaylandInputDevice *device, int serial); QWaylandWindow *m_window; diff --git a/src/client/qwaylandxdgpopup.cpp b/src/client/qwaylandxdgpopup.cpp index abc25278..57800f17 100644 --- a/src/client/qwaylandxdgpopup.cpp +++ b/src/client/qwaylandxdgpopup.cpp @@ -56,6 +56,12 @@ QWaylandXdgPopup::~QWaylandXdgPopup() delete m_extendedWindow; } +void QWaylandXdgPopup::setType(Qt::WindowType type, QWaylandWindow *transientParent) +{ + Q_UNUSED(type); + Q_UNUSED(transientParent); +} + } QT_END_NAMESPACE diff --git a/src/client/qwaylandxdgpopup_p.h b/src/client/qwaylandxdgpopup_p.h index ff580411..64bb4d96 100644 --- a/src/client/qwaylandxdgpopup_p.h +++ b/src/client/qwaylandxdgpopup_p.h @@ -68,6 +68,8 @@ public: QWaylandXdgPopup(struct ::xdg_popup *popup, QWaylandWindow *window); virtual ~QWaylandXdgPopup(); + void setType(Qt::WindowType type, QWaylandWindow *transientParent) override; + private: QWaylandExtendedSurface *m_extendedWindow; }; diff --git a/src/client/qwaylandxdgsurface.cpp b/src/client/qwaylandxdgsurface.cpp index a3bbb064..fe8761e5 100644 --- a/src/client/qwaylandxdgsurface.cpp +++ b/src/client/qwaylandxdgsurface.cpp @@ -128,17 +128,11 @@ void QWaylandXdgSurface::setMinimized() set_minimized(); } -void QWaylandXdgSurface::setTopLevel() +void QWaylandXdgSurface::updateTransientParent(QWaylandWindow *parent) { - // There's no xdg_shell_surface API for this, ignoring -} - -void QWaylandXdgSurface::updateTransientParent(QWindow *parent) -{ - QWaylandWindow *parent_wayland_window = static_cast(parent->handle()); - if (!parent_wayland_window) + if (!parent) return; - auto parentXdgSurface = qobject_cast(parent_wayland_window->shellSurface()); + auto parentXdgSurface = qobject_cast(parent->shellSurface()); Q_ASSERT(parentXdgSurface); set_parent(parentXdgSurface->object()); } @@ -183,6 +177,13 @@ void QWaylandXdgSurface::sendProperty(const QString &name, const QVariant &value m_extendedWindow->updateGenericProperty(name, value); } +void QWaylandXdgSurface::setType(Qt::WindowType type, QWaylandWindow *transientParent) +{ + Q_UNUSED(type) + if (transientParent) + updateTransientParent(transientParent); +} + void QWaylandXdgSurface::xdg_surface_configure(int32_t width, int32_t height, struct wl_array *states,uint32_t serial) { uint32_t *state = reinterpret_cast(states->data); diff --git a/src/client/qwaylandxdgsurface_p.h b/src/client/qwaylandxdgsurface_p.h index 1a5eeed7..265d3ba8 100644 --- a/src/client/qwaylandxdgsurface_p.h +++ b/src/client/qwaylandxdgsurface_p.h @@ -99,14 +99,15 @@ public: bool isFullscreen() const { return m_fullscreen; } bool isMaximized() const { return m_maximized; } + void setType(Qt::WindowType type, QWaylandWindow *transientParent) override; + private: void setMaximized() Q_DECL_OVERRIDE; void setFullscreen() Q_DECL_OVERRIDE; void setNormal() Q_DECL_OVERRIDE; void setMinimized() Q_DECL_OVERRIDE; - void setTopLevel() Q_DECL_OVERRIDE; - void updateTransientParent(QWindow *parent) Q_DECL_OVERRIDE; + void updateTransientParent(QWaylandWindow *parent); private: QWaylandWindow *m_window; diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp b/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp index 236218e7..6b5c5326 100644 --- a/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp +++ b/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp @@ -159,6 +159,12 @@ void QWaylandEglWindow::setVisible(bool visible) { QWaylandWindow::setVisible(visible); if (!visible) + QMetaObject::invokeMethod(this, "doInvalidateSurface", Qt::QueuedConnection); +} + +void QWaylandEglWindow::doInvalidateSurface() +{ + if (!window()->isVisible()) invalidateSurface(); } @@ -168,6 +174,10 @@ void QWaylandEglWindow::invalidateSurface() eglDestroySurface(m_clientBufferIntegration->eglDisplay(), m_eglSurface); m_eglSurface = 0; } + if (m_waylandEglWindow) { + wl_egl_window_destroy(m_waylandEglWindow); + m_waylandEglWindow = nullptr; + } } EGLSurface QWaylandEglWindow::eglSurface() const diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.h b/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.h index 556ed687..bf656689 100644 --- a/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.h +++ b/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.h @@ -54,6 +54,7 @@ class QWaylandGLContext; class QWaylandEglWindow : public QWaylandWindow { + Q_OBJECT public: QWaylandEglWindow(QWindow *window); ~QWaylandEglWindow(); @@ -75,6 +76,9 @@ public: void invalidateSurface() Q_DECL_OVERRIDE; void setVisible(bool visible) Q_DECL_OVERRIDE; +private Q_SLOTS: + void doInvalidateSurface(); + private: QWaylandEglClientBufferIntegration *m_clientBufferIntegration; struct wl_egl_window *m_waylandEglWindow; diff --git a/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglcontext.cpp b/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglcontext.cpp index e2e2f551..c07ad534 100644 --- a/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglcontext.cpp +++ b/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglcontext.cpp @@ -64,9 +64,7 @@ void QWaylandXCompositeEGLContext::swapBuffers(QPlatformSurface *surface) QSize size = w->geometry().size(); - w->attach(w->buffer(), 0, 0); - w->damage(QRect(QPoint(), size)); - w->commit(); + w->commit(w->buffer(), QRegion(0, 0, size.width(), size.height())); w->waitForFrameSync(); } diff --git a/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxcontext.cpp b/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxcontext.cpp index bc6e94fe..439acc00 100644 --- a/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxcontext.cpp +++ b/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxcontext.cpp @@ -90,9 +90,7 @@ void QWaylandXCompositeGLXContext::swapBuffers(QPlatformSurface *surface) glXSwapBuffers(m_display, w->xWindow()); - w->attach(w->buffer(), 0, 0); - w->damage(QRect(QPoint(), size)); - w->commit(); + w->commit(w->buffer(), QRegion(0, 0, size.width(), size.height())); w->waitForFrameSync(); } diff --git a/src/plugins/shellintegration/ivi-shell/qwaylandivisurface.cpp b/src/plugins/shellintegration/ivi-shell/qwaylandivisurface.cpp index f8871fa2..ecc47e0b 100644 --- a/src/plugins/shellintegration/ivi-shell/qwaylandivisurface.cpp +++ b/src/plugins/shellintegration/ivi-shell/qwaylandivisurface.cpp @@ -71,6 +71,13 @@ QWaylandIviSurface::~QWaylandIviSurface() delete m_extendedWindow; } +void QWaylandIviSurface::setType(Qt::WindowType type, QWaylandWindow *transientParent) +{ + + Q_UNUSED(type) + Q_UNUSED(transientParent) +} + void QWaylandIviSurface::createExtendedSurface(QWaylandWindow *window) { if (window->display()->windowExtension()) diff --git a/src/plugins/shellintegration/ivi-shell/qwaylandivisurface_p.h b/src/plugins/shellintegration/ivi-shell/qwaylandivisurface_p.h index 96978e28..9ac81ad6 100644 --- a/src/plugins/shellintegration/ivi-shell/qwaylandivisurface_p.h +++ b/src/plugins/shellintegration/ivi-shell/qwaylandivisurface_p.h @@ -56,6 +56,8 @@ public: struct ::ivi_controller_surface *iviControllerSurface); virtual ~QWaylandIviSurface(); + void setType(Qt::WindowType type, QWaylandWindow *transientParent) override; + private: void createExtendedSurface(QWaylandWindow *window); virtual void ivi_surface_configure(int32_t width, int32_t height) Q_DECL_OVERRIDE; diff --git a/tests/auto/client/client/tst_client.cpp b/tests/auto/client/client/tst_client.cpp index 74363ef5..6aad25bb 100644 --- a/tests/auto/client/client/tst_client.cpp +++ b/tests/auto/client/client/tst_client.cpp @@ -248,8 +248,8 @@ void tst_WaylandClient::backingStore() window.hide(); - // hiding the window should detach the buffer - QTRY_VERIFY(surface->image.isNull()); + // hiding the window should destroy the surface + QTRY_VERIFY(!compositor->surface()); } class DndWindow : public QWindow -- cgit v1.2.1 From 7197be7c0e9d00f98551d12bcc30782503612fe9 Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Wed, 16 Nov 2016 14:43:20 +0100 Subject: Client: Close popups on xdg_popup::popup_done Change-Id: I6d3b1ec5c22e6d07ed87948074d886cc9aa126ef Reviewed-by: Paul Olav Tvete --- src/client/qwaylandxdgpopup.cpp | 6 ++++++ src/client/qwaylandxdgpopup_p.h | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/src/client/qwaylandxdgpopup.cpp b/src/client/qwaylandxdgpopup.cpp index 57800f17..318f78ac 100644 --- a/src/client/qwaylandxdgpopup.cpp +++ b/src/client/qwaylandxdgpopup.cpp @@ -45,6 +45,7 @@ QWaylandXdgPopup::QWaylandXdgPopup(struct ::xdg_popup *popup, QWaylandWindow *wi : QWaylandShellSurface(window) , QtWayland::xdg_popup(popup) , m_extendedWindow(nullptr) + , m_window(window) { if (window->display()->windowExtension()) m_extendedWindow = new QWaylandExtendedSurface(window); @@ -62,6 +63,11 @@ void QWaylandXdgPopup::setType(Qt::WindowType type, QWaylandWindow *transientPar Q_UNUSED(transientParent); } +void QWaylandXdgPopup::xdg_popup_popup_done() +{ + m_window->window()->close(); +} + } QT_END_NAMESPACE diff --git a/src/client/qwaylandxdgpopup_p.h b/src/client/qwaylandxdgpopup_p.h index 64bb4d96..04416dbb 100644 --- a/src/client/qwaylandxdgpopup_p.h +++ b/src/client/qwaylandxdgpopup_p.h @@ -70,8 +70,12 @@ public: void setType(Qt::WindowType type, QWaylandWindow *transientParent) override; +protected: + void xdg_popup_popup_done() override; + private: QWaylandExtendedSurface *m_extendedWindow; + QWaylandWindow *m_window; }; QT_END_NAMESPACE -- cgit v1.2.1 From fc1901b4b34d29df79be1b9b1c1d3f5a127eaa59 Mon Sep 17 00:00:00 2001 From: Giulio Camuffo Date: Sat, 19 Nov 2016 08:58:17 +0100 Subject: Don't reset the cursor at every mouse move Change-Id: I67f9a0d171da403ebb124ab584c2510891da80fc Reviewed-by: Paul Olav Tvete --- src/client/qwaylandinputdevice.cpp | 14 ++++++++++++++ src/client/qwaylandinputdevice_p.h | 5 ++++- src/client/qwaylandwindow.cpp | 6 +----- src/client/qwaylandwindow_p.h | 1 - 4 files changed, 19 insertions(+), 7 deletions(-) diff --git a/src/client/qwaylandinputdevice.cpp b/src/client/qwaylandinputdevice.cpp index 94316baf..de052089 100644 --- a/src/client/qwaylandinputdevice.cpp +++ b/src/client/qwaylandinputdevice.cpp @@ -147,6 +147,8 @@ QWaylandInputDevice::Pointer::Pointer(QWaylandInputDevice *p) , mEnterSerial(0) , mCursorSerial(0) , mButtons(0) + , mCursorBuffer(nullptr) + , mCursorShape(Qt::BitmapCursor) { } @@ -362,6 +364,10 @@ void QWaylandInputDevice::setCursor(Qt::CursorShape newShape, QWaylandScreen *sc void QWaylandInputDevice::setCursor(const QCursor &cursor, QWaylandScreen *screen) { + if (cursor.shape() != Qt::BitmapCursor && cursor.shape() == mPointer->mCursorShape) + return; + + mPointer->mCursorShape = cursor.shape(); if (cursor.shape() == Qt::BitmapCursor) { setCursor(screen->waylandCursor()->cursorBitmapImage(&cursor), cursor.hotSpot()); return; @@ -379,8 +385,16 @@ void QWaylandInputDevice::setCursor(struct wl_buffer *buffer, struct wl_cursor_i void QWaylandInputDevice::setCursor(struct wl_buffer *buffer, const QPoint &hotSpot, const QSize &size) { if (mCaps & WL_SEAT_CAPABILITY_POINTER) { + bool force = mPointer->mEnterSerial > mPointer->mCursorSerial; + + if (!force && mPointer->mCursorBuffer == buffer) + return; + mPixmapCursor.clear(); mPointer->mCursorSerial = mPointer->mEnterSerial; + + mPointer->mCursorBuffer = buffer; + /* Hide cursor */ if (!buffer) { diff --git a/src/client/qwaylandinputdevice_p.h b/src/client/qwaylandinputdevice_p.h index 2f39bc54..d41bde56 100644 --- a/src/client/qwaylandinputdevice_p.h +++ b/src/client/qwaylandinputdevice_p.h @@ -99,7 +99,6 @@ public: struct ::wl_seat *wl_seat() { return QtWayland::wl_seat::object(); } - void setCursor(Qt::CursorShape cursor, QWaylandScreen *screen); void setCursor(const QCursor &cursor, QWaylandScreen *screen); void setCursor(struct wl_buffer *buffer, struct ::wl_cursor_image *image); void setCursor(struct wl_buffer *buffer, const QPoint &hotSpot, const QSize &size); @@ -129,6 +128,8 @@ public: virtual Touch *createTouch(QWaylandInputDevice *device); private: + void setCursor(Qt::CursorShape cursor, QWaylandScreen *screen); + QWaylandDisplay *mQDisplay; struct wl_display *mDisplay; @@ -249,6 +250,8 @@ public: QPointF mSurfacePos; QPointF mGlobalPos; Qt::MouseButtons mButtons; + wl_buffer *mCursorBuffer; + Qt::CursorShape mCursorShape; }; class Q_WAYLAND_CLIENT_EXPORT QWaylandInputDevice::Touch : public QtWayland::wl_touch diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp index 1ff6686f..8e40f3b3 100644 --- a/src/client/qwaylandwindow.cpp +++ b/src/client/qwaylandwindow.cpp @@ -81,7 +81,6 @@ QWaylandWindow::QWaylandWindow(QWindow *window) , mWindowDecoration(0) , mMouseEventsInContentArea(false) , mMousePressedInContentArea(Qt::NoButton) - , m_cursor(Qt::ArrowCursor) , mWaitingForFrameSync(false) , mFrameCallback(nullptr) , mRequestResizeSent(false) @@ -780,10 +779,7 @@ void QWaylandWindow::handleMouseEventWithDecoration(QWaylandInputDevice *inputDe void QWaylandWindow::setMouseCursor(QWaylandInputDevice *device, const QCursor &cursor) { - if (device->serial() >= device->cursorSerial()) { - device->setCursor(cursor, mScreen); - m_cursor = cursor; - } + device->setCursor(cursor, mScreen); } void QWaylandWindow::restoreMouseCursor(QWaylandInputDevice *device) diff --git a/src/client/qwaylandwindow_p.h b/src/client/qwaylandwindow_p.h index 7e7078fc..f5988fbd 100644 --- a/src/client/qwaylandwindow_p.h +++ b/src/client/qwaylandwindow_p.h @@ -217,7 +217,6 @@ protected: QWaylandAbstractDecoration *mWindowDecoration; bool mMouseEventsInContentArea; Qt::MouseButtons mMousePressedInContentArea; - QCursor m_cursor; WId mWindowId; bool mWaitingForFrameSync; -- cgit v1.2.1 From 8493c29c0b739d0de2d79461695e615536031227 Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Mon, 21 Nov 2016 12:18:51 +0100 Subject: Make sure we send leave events in the c++ example The code was there, but an unfortunate null pointer check made us skip sending leave events. Change-Id: I3095949ac41330fc10e2a97c025d94d47bc6ea4e Reviewed-by: Johan Helsing --- examples/wayland/qwindow-compositor/window.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/examples/wayland/qwindow-compositor/window.cpp b/examples/wayland/qwindow-compositor/window.cpp index 371e0de8..a61e4d98 100644 --- a/examples/wayland/qwindow-compositor/window.cpp +++ b/examples/wayland/qwindow-compositor/window.cpp @@ -257,10 +257,9 @@ void Window::mouseMoveEvent(QMouseEvent *e) void Window::sendMouseEvent(QMouseEvent *e, View *target) { - if (!target) - return; - - QPointF mappedPos = e->localPos() - target->position(); + QPointF mappedPos = e->localPos(); + if (target) + mappedPos -= target->position(); QMouseEvent viewEvent(e->type(), mappedPos, e->localPos(), e->button(), e->buttons(), e->modifiers()); m_compositor->handleMouseEvent(target, &viewEvent); } -- cgit v1.2.1 From 61e2b73e0922bd9983cd45a274ab4b813b380aff Mon Sep 17 00:00:00 2001 From: Donald Carr Date: Tue, 15 Nov 2016 09:11:25 -0800 Subject: Fix build of brcm-egl client Addendum to 3443483c9efdcfbfe049f96c83f83a5bf1d81e61 Change-Id: I915495d506efaa23f8f901293ee12ef5ec1736de Reviewed-by: Oswald Buddenhagen Reviewed-by: Paul Olav Tvete --- src/hardwareintegration/client/brcm-egl/brcm-egl.pri | 1 + 1 file changed, 1 insertion(+) diff --git a/src/hardwareintegration/client/brcm-egl/brcm-egl.pri b/src/hardwareintegration/client/brcm-egl/brcm-egl.pri index c4ccdcc6..e4fd68f3 100644 --- a/src/hardwareintegration/client/brcm-egl/brcm-egl.pri +++ b/src/hardwareintegration/client/brcm-egl/brcm-egl.pri @@ -8,6 +8,7 @@ contains(QT_CONFIG, no-pkg-config) { } CONFIG += egl +QT += egl_support-private SOURCES += $$PWD/qwaylandbrcmeglintegration.cpp \ $$PWD/qwaylandbrcmglcontext.cpp \ -- cgit v1.2.1 From c445cf7d4e517248013e707a5050f9e0408a2746 Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Mon, 21 Nov 2016 11:53:26 +0100 Subject: Only send mouse move event when mouse moves Qt Quick recently changed to send hover events 60 times per second even if the mouse doesn't move. Make sure we only send mouse move events over the Wayland protocol if the mouse actually moved. Change-Id: Ic196512dde1718de461eb2c64cec2e95e220ce89 Reviewed-by: Johan Helsing --- src/compositor/compositor_api/qwaylandquickitem.cpp | 8 +++++++- src/compositor/compositor_api/qwaylandquickitem_p.h | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/compositor/compositor_api/qwaylandquickitem.cpp b/src/compositor/compositor_api/qwaylandquickitem.cpp index d57cbb42..9bf42813 100644 --- a/src/compositor/compositor_api/qwaylandquickitem.cpp +++ b/src/compositor/compositor_api/qwaylandquickitem.cpp @@ -481,6 +481,7 @@ void QWaylandQuickItem::mousePressEvent(QMouseEvent *event) seat->sendMouseMoveEvent(d->view.data(), mapToSurface(event->localPos()), event->windowPos()); seat->sendMousePressEvent(event->button()); + d->hoverPos = event->pos(); } /*! @@ -503,6 +504,7 @@ void QWaylandQuickItem::mouseMoveEvent(QMouseEvent *event) } } else { seat->sendMouseMoveEvent(d->view.data(), mapToSurface(event->localPos()), event->windowPos()); + d->hoverPos = event->pos(); } } else { emit mouseMove(event->windowPos()); @@ -543,6 +545,7 @@ void QWaylandQuickItem::hoverEnterEvent(QHoverEvent *event) if (d->shouldSendInputEvents()) { QWaylandSeat *seat = compositor()->seatFor(event); seat->sendMouseMoveEvent(d->view.data(), event->pos(), mapToScene(event->pos())); + d->hoverPos = event->pos(); } else { event->ignore(); } @@ -562,7 +565,10 @@ void QWaylandQuickItem::hoverMoveEvent(QHoverEvent *event) } if (d->shouldSendInputEvents()) { QWaylandSeat *seat = compositor()->seatFor(event); - seat->sendMouseMoveEvent(d->view.data(), mapToSurface(event->pos()), mapToScene(event->pos())); + if (event->pos() != d->hoverPos) { + seat->sendMouseMoveEvent(d->view.data(), mapToSurface(event->pos()), mapToScene(event->pos())); + d->hoverPos = event->pos(); + } } else { event->ignore(); } diff --git a/src/compositor/compositor_api/qwaylandquickitem_p.h b/src/compositor/compositor_api/qwaylandquickitem_p.h index 441ac976..fc69fe09 100644 --- a/src/compositor/compositor_api/qwaylandquickitem_p.h +++ b/src/compositor/compositor_api/qwaylandquickitem_p.h @@ -173,6 +173,7 @@ public: bool newTexture; bool focusOnClick; bool sizeFollowsSurface; + QPoint hoverPos; QQuickWindow *connectedWindow; QWaylandSurface::Origin origin; -- cgit v1.2.1 From 1d5b44cbb1e834bc8db94d8ec1ac140b8ca9ed37 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Thu, 3 Nov 2016 15:14:47 +0100 Subject: Move qtwayland over to use the new configuration system Re-use configuration results from qtbase where possible and move all pkg-config handling over to be done at configuration time. Since waylandclient and waylandcompositor are two independent libs, this required some duplication of features and libraries used by both in the configure.json files. Change-Id: I1f3ec56c85cb780324cc7634a3ad7951125853a0 Reviewed-by: Oswald Buddenhagen Reviewed-by: Paul Olav Tvete --- config.tests/brcm_egl/brcm_egl.pro | 13 -- config.tests/brcm_egl/main.cpp | 71 ----------- config.tests/drm_egl_server/drm_egl_server.pro | 13 -- config.tests/glx/glx.pro | 13 -- .../libhybris_egl_server/libhybris_egl_server.pro | 13 -- config.tests/wayland/wayland.pro | 13 +- config.tests/wayland_cursor/wayland_cursor.pro | 11 -- config.tests/wayland_egl/wayland_egl.pro | 14 --- config.tests/wayland_scanner/wayland_scanner.pro | 7 -- config.tests/xcomposite/xcomposite.pro | 13 -- config.tests/xkbcommon/main.cpp | 67 ----------- config.tests/xkbcommon/xkbcommon.pro | 12 -- configure.json | 6 + .../custom-extension/client-common/client.pro | 7 -- .../custom-extension/compositor/compositor.pro | 7 -- .../custom-extension/cpp-client/cpp-client.pro | 9 -- .../custom-extension/qml-client/qml-client.pro | 10 -- examples/wayland/server-buffer/client/client.pro | 8 -- .../server-buffer/compositor/compositor.pro | 7 -- examples/wayland/wayland.pro | 18 +-- qtwayland.pro | 36 ------ src/client/client.pro | 17 +-- src/client/configure.json | 134 +++++++++++++++++++++ src/compositor/compositor.pro | 9 +- src/compositor/compositor_api/compositor_api.pri | 2 +- src/compositor/configure.json | 99 +++++++++++++++ src/compositor/wayland_wrapper/wayland_wrapper.pri | 8 +- .../client/brcm-egl/brcm-egl.pri | 9 +- .../client/drm-egl-server/drm-egl-server.pri | 9 +- .../libhybris-egl-server/libhybris-egl-server.pri | 7 +- .../client/wayland-egl/wayland-egl.pri | 9 +- .../client/xcomposite-egl/xcomposite-egl.pri | 8 +- .../client/xcomposite-glx/xcomposite-glx.pri | 7 +- .../client/xcomposite_share/xcomposite_share.pri | 1 + .../compositor/brcm-egl/brcm-egl.pri | 7 +- .../compositor/drm-egl-server/drm-egl-server.pri | 9 +- .../libhybris-egl-server/libhybris-egl-server.pri | 9 +- .../compositor/wayland-egl/wayland-egl.pri | 8 +- .../compositor/xcomposite-egl/xcomposite-egl.pri | 9 +- .../compositor/xcomposite-glx/xcomposite-glx.pri | 7 +- .../xcomposite_share/xcomposite_share.pri | 1 + src/plugins/decorations/bradient/bradient.pro | 7 +- src/plugins/hardwareintegration/client/client.pro | 24 ++-- .../hardwareintegration/compositor/compositor.pro | 23 ++-- src/plugins/platforms/platforms.pro | 16 ++- .../shellintegration/ivi-shell/ivi-shell.pro | 17 +-- src/src.pro | 46 ++++--- tests/auto/auto.pro | 8 +- tests/auto/client/client/client.pro | 6 +- tests/auto/compositor/compositor/compositor.pro | 14 +-- 50 files changed, 341 insertions(+), 557 deletions(-) delete mode 100644 config.tests/brcm_egl/brcm_egl.pro delete mode 100644 config.tests/brcm_egl/main.cpp delete mode 100644 config.tests/xkbcommon/main.cpp delete mode 100644 config.tests/xkbcommon/xkbcommon.pro create mode 100644 configure.json create mode 100644 src/client/configure.json create mode 100644 src/compositor/configure.json diff --git a/config.tests/brcm_egl/brcm_egl.pro b/config.tests/brcm_egl/brcm_egl.pro deleted file mode 100644 index a6b416f1..00000000 --- a/config.tests/brcm_egl/brcm_egl.pro +++ /dev/null @@ -1,13 +0,0 @@ -TARGET = brcm_egl -CONFIG -= qt - -INCLUDEPATH += $$QMAKE_INCDIR_EGL - -for(p, QMAKE_LIBDIR_EGL) { - exists($$p):LIBS += -L$$p -} - -LIBS += $$QMAKE_LIBS_EGL - -# Input -SOURCES += main.cpp diff --git a/config.tests/brcm_egl/main.cpp b/config.tests/brcm_egl/main.cpp deleted file mode 100644 index bb3cab73..00000000 --- a/config.tests/brcm_egl/main.cpp +++ /dev/null @@ -1,71 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Compositor. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include - -#include -#include - -#include - -int main() -{ - EGLDisplay display = eglGetDisplay((EGLNativeDisplayType)EGL_DEFAULT_DISPLAY); - if (!display) { - fprintf(stderr, "No EGL display"); - return -1; - } - - EGLint major, minor; - if (!eglInitialize(display, &major, &minor)) { - fprintf(stderr, "Failed to initialize EGL"); - return -1; - } - - EGLint pixel_format = EGL_PIXEL_FORMAT_ARGB_8888_BRCM; - - EGLint id[2]; - PFNEGLCREATEGLOBALIMAGEBRCMPROC createImage = (PFNEGLCREATEGLOBALIMAGEBRCMPROC)eglGetProcAddress("eglCreateGlobalImageBRCM"); - createImage(32, 32, pixel_format, 0, 32 * 4, id); - - eglTerminate(display); - - return 0; -} diff --git a/config.tests/drm_egl_server/drm_egl_server.pro b/config.tests/drm_egl_server/drm_egl_server.pro index 328354eb..28dcadcb 100644 --- a/config.tests/drm_egl_server/drm_egl_server.pro +++ b/config.tests/drm_egl_server/drm_egl_server.pro @@ -1,14 +1 @@ -TARGET = drm_egl_server -QT = core - -!contains(QT_CONFIG, opengl): error("drm_egl_server support requires Qt configured with OpenGL") - -!contains(QT_CONFIG, no-pkg-config) { - CONFIG += link_pkgconfig - PKGCONFIG += egl -} else { - LIBS += -legl -} - -# Input SOURCES += main.cpp diff --git a/config.tests/glx/glx.pro b/config.tests/glx/glx.pro index 74cc6083..28dcadcb 100644 --- a/config.tests/glx/glx.pro +++ b/config.tests/glx/glx.pro @@ -1,14 +1 @@ -TARGET = glx -QT = core - -!contains(QT_CONFIG, opengl): error("glx support requires Qt configured with OpenGL") - -!contains(QT_CONFIG, no-pkg-config) { - CONFIG += link_pkgconfig - PKGCONFIG += x11 gl -} else { - LIBS += -lX11 -lGL -} - -# Input SOURCES += main.cpp diff --git a/config.tests/libhybris_egl_server/libhybris_egl_server.pro b/config.tests/libhybris_egl_server/libhybris_egl_server.pro index bc358d55..28dcadcb 100644 --- a/config.tests/libhybris_egl_server/libhybris_egl_server.pro +++ b/config.tests/libhybris_egl_server/libhybris_egl_server.pro @@ -1,14 +1 @@ -TARGET = libhybris_egl_server -QT = core - -!contains(QT_CONFIG, opengl): error("libhybris_egl_server support requires Qt configured with OpenGL") - -!contains(QT_CONFIG, no-pkg-config) { - CONFIG += link_pkgconfig - PKGCONFIG += egl -} else { - LIBS += -legl -} - -# Input SOURCES += main.cpp diff --git a/config.tests/wayland/wayland.pro b/config.tests/wayland/wayland.pro index 5873d92d..28dcadcb 100644 --- a/config.tests/wayland/wayland.pro +++ b/config.tests/wayland/wayland.pro @@ -1,12 +1 @@ -TARGET = wayland -QT = core - -!contains(QT_CONFIG, no-pkg-config) { - CONFIG += link_pkgconfig - PKGCONFIG += wayland-client -} else { - LIBS += -lwayland-client -} - -# Input -SOURCES += main.cpp \ No newline at end of file +SOURCES += main.cpp diff --git a/config.tests/wayland_cursor/wayland_cursor.pro b/config.tests/wayland_cursor/wayland_cursor.pro index aa38d32f..28dcadcb 100644 --- a/config.tests/wayland_cursor/wayland_cursor.pro +++ b/config.tests/wayland_cursor/wayland_cursor.pro @@ -1,12 +1 @@ -TARGET = wayland_cursor -QT = core - -!contains(QT_CONFIG, no-pkg-config) { - CONFIG += link_pkgconfig - PKGCONFIG += wayland-cursor -} else { - LIBS += -lwayland-cursor -} - -# Input SOURCES += main.cpp diff --git a/config.tests/wayland_egl/wayland_egl.pro b/config.tests/wayland_egl/wayland_egl.pro index 42d6b131..28dcadcb 100644 --- a/config.tests/wayland_egl/wayland_egl.pro +++ b/config.tests/wayland_egl/wayland_egl.pro @@ -1,15 +1 @@ -TARGET = wayland_egl -QT = core - -!contains(QT_CONFIG, opengl): error("wayland_egl support requires Qt configured with OpenGL") -!contains(QT_CONFIG, egl): error("wayland_egl support requires Qt configured with EGL") - -!contains(QT_CONFIG, no-pkg-config) { - CONFIG += link_pkgconfig - PKGCONFIG += wayland-egl -} else { - LIBS += -lwayland-egl -} - -# Input SOURCES += main.cpp diff --git a/config.tests/wayland_scanner/wayland_scanner.pro b/config.tests/wayland_scanner/wayland_scanner.pro index 300e439e..03da69dc 100644 --- a/config.tests/wayland_scanner/wayland_scanner.pro +++ b/config.tests/wayland_scanner/wayland_scanner.pro @@ -2,13 +2,6 @@ TARGET = wayland_scanner isEmpty(QMAKE_WAYLAND_SCANNER):error("QMAKE_WAYLAND_SCANNER not defined for this mkspec") -!contains(QT_CONFIG, no-pkg-config) { - CONFIG += link_pkgconfig - PKGCONFIG += wayland-client -} else { - LIBS += -lwayland-client -} - # Input SOURCES += main.cpp diff --git a/config.tests/xcomposite/xcomposite.pro b/config.tests/xcomposite/xcomposite.pro index 6838970a..28dcadcb 100644 --- a/config.tests/xcomposite/xcomposite.pro +++ b/config.tests/xcomposite/xcomposite.pro @@ -1,14 +1 @@ -TARGET = xcomposite -QT = core - -!contains(QT_CONFIG, opengl): error("xcomposite support requires Qt configured with OpenGL") - -!contains(QT_CONFIG, no-pkg-config) { - CONFIG += link_pkgconfig - PKGCONFIG += xcomposite -} else { - LIBS += -lXcomposite -} - -# Input SOURCES += main.cpp diff --git a/config.tests/xkbcommon/main.cpp b/config.tests/xkbcommon/main.cpp deleted file mode 100644 index 97162f3d..00000000 --- a/config.tests/xkbcommon/main.cpp +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Compositor. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include -#include -#include - -int main() -{ - xkb_rule_names names; - names.rules = strdup("evdev"); - names.model = strdup("pc105"); - names.layout = strdup("us"); - names.variant = strdup(""); - names.options = strdup(""); - - xkb_context *context = xkb_context_new(xkb_context_flags(0)); - if (context) { - xkb_keymap * keymap = xkb_map_new_from_names(context, &names, xkb_map_compile_flags(0)); - if (keymap) { - xkb_state *state = xkb_state_new(keymap); - if (state) - xkb_state_unref(state); - xkb_map_unref(keymap); - } - xkb_context_unref(context); - } - - return 0; -} diff --git a/config.tests/xkbcommon/xkbcommon.pro b/config.tests/xkbcommon/xkbcommon.pro deleted file mode 100644 index af6668bc..00000000 --- a/config.tests/xkbcommon/xkbcommon.pro +++ /dev/null @@ -1,12 +0,0 @@ -TARGET = xkbcommon -QT = core - -!contains(QT_CONFIG, no-pkg-config) { - CONFIG += link_pkgconfig - PKGCONFIG += xkbcommon -} else { - LIBS += -lxkbcommon -} - -# Input -SOURCES += main.cpp diff --git a/configure.json b/configure.json new file mode 100644 index 00000000..42bfa9d9 --- /dev/null +++ b/configure.json @@ -0,0 +1,6 @@ +{ + "subconfigs": [ + "src/client", + "src/compositor" + ] +} diff --git a/examples/wayland/custom-extension/client-common/client.pro b/examples/wayland/custom-extension/client-common/client.pro index 9ba72bc9..95b99578 100644 --- a/examples/wayland/custom-extension/client-common/client.pro +++ b/examples/wayland/custom-extension/client-common/client.pro @@ -1,14 +1,7 @@ CONFIG += wayland-scanner -CONFIG += link_pkgconfig - TARGET = custom-wayland QT += waylandclient-private -!contains(QT_CONFIG, no-pkg-config) { - PKGCONFIG += wayland-client -} else { - LIBS += -lwayland-client -} WAYLANDCLIENTSOURCES += ../protocol/custom.xml diff --git a/examples/wayland/custom-extension/compositor/compositor.pro b/examples/wayland/custom-extension/compositor/compositor.pro index 4ffafdb8..b0ff7b2f 100644 --- a/examples/wayland/custom-extension/compositor/compositor.pro +++ b/examples/wayland/custom-extension/compositor/compositor.pro @@ -18,13 +18,6 @@ WAYLANDSERVERSOURCES += \ RESOURCES += compositor.qrc -contains(QT_CONFIG, no-pkg-config) { - LIBS += -lwayland-server -} else { - CONFIG += link_pkgconfig - PKGCONFIG += wayland-server -} - TARGET = custom-compositor HEADERS += \ diff --git a/examples/wayland/custom-extension/cpp-client/cpp-client.pro b/examples/wayland/custom-extension/cpp-client/cpp-client.pro index 54fead07..b700f236 100644 --- a/examples/wayland/custom-extension/cpp-client/cpp-client.pro +++ b/examples/wayland/custom-extension/cpp-client/cpp-client.pro @@ -1,17 +1,8 @@ QT += waylandclient-private gui-private - -CONFIG += c++11 CONFIG += wayland-scanner -CONFIG += link_pkgconfig WAYLANDCLIENTSOURCES += ../protocol/custom.xml -!contains(QT_CONFIG, no-pkg-config) { - PKGCONFIG += wayland-client -} else { - LIBS += -lwayland-client -} - SOURCES += main.cpp \ ../client-common/customextension.cpp diff --git a/examples/wayland/custom-extension/qml-client/qml-client.pro b/examples/wayland/custom-extension/qml-client/qml-client.pro index aec29d2b..d45067e5 100644 --- a/examples/wayland/custom-extension/qml-client/qml-client.pro +++ b/examples/wayland/custom-extension/qml-client/qml-client.pro @@ -1,19 +1,9 @@ TEMPLATE = app - QT += qml quick waylandclient-private - -CONFIG += c++11 CONFIG += wayland-scanner -CONFIG += link_pkgconfig WAYLANDCLIENTSOURCES += ../protocol/custom.xml -!contains(QT_CONFIG, no-pkg-config) { - PKGCONFIG += wayland-client -} else { - LIBS += -lwayland-client -} - SOURCES += main.cpp \ ../client-common/customextension.cpp diff --git a/examples/wayland/server-buffer/client/client.pro b/examples/wayland/server-buffer/client/client.pro index 6e5cc87e..459a407a 100644 --- a/examples/wayland/server-buffer/client/client.pro +++ b/examples/wayland/server-buffer/client/client.pro @@ -3,14 +3,6 @@ TARGET = client INCLUDEPATH += . QT += waylandclient-private - -contains(QT_CONFIG, no-pkg-config) { - LIBS += -lwayland-client -} else { - CONFIG += link_pkgconfig - PKGCONFIG += wayland-client -} - CONFIG += wayland-scanner WAYLANDCLIENTSOURCES += ../share-buffer.xml diff --git a/examples/wayland/server-buffer/compositor/compositor.pro b/examples/wayland/server-buffer/compositor/compositor.pro index 28a781bd..45240af9 100644 --- a/examples/wayland/server-buffer/compositor/compositor.pro +++ b/examples/wayland/server-buffer/compositor/compositor.pro @@ -1,12 +1,5 @@ QT += core-private gui-private quick-private waylandcompositor-private -contains(QT_CONFIG, no-pkg-config) { - LIBS += -lwayland-server -} else { - CONFIG += link_pkgconfig - PKGCONFIG += wayland-server -} - SOURCES += \ main.cpp \ serverbufferitem.cpp diff --git a/examples/wayland/wayland.pro b/examples/wayland/wayland.pro index 2a539500..6024dd2d 100644 --- a/examples/wayland/wayland.pro +++ b/examples/wayland/wayland.pro @@ -1,17 +1,21 @@ +requires(qtHaveModule(waylandcompositor)) +requires(qtConfig(opengl)) TEMPLATE=subdirs -contains(QT_CONFIG, opengl) { - SUBDIRS += qwindow-compositor - SUBDIRS += minimal-cpp -} +SUBDIRS += \ + qwindow-compositor + minimal-cpp -contains(QT_CONFIG, opengl):qtHaveModule(quick) { +qtHaveModule(quick) { SUBDIRS += minimal-qml SUBDIRS += spanning-screens SUBDIRS += pure-qml SUBDIRS += multi-output SUBDIRS += multi-screen - SUBDIRS += custom-extension - SUBDIRS += server-buffer SUBDIRS += ivi-compositor + qtHaveModule(waylandclient) { + SUBDIRS += \ + custom-extension \ + server-buffer + } } diff --git a/qtwayland.pro b/qtwayland.pro index f71b842d..0401ab02 100644 --- a/qtwayland.pro +++ b/qtwayland.pro @@ -1,38 +1,2 @@ requires(linux:!android) - -load(configure) -qtCompileTest(wayland) -qtCompileTest(xkbcommon) -qtCompileTest(wayland_cursor) -qtCompileTest(wayland_scanner) -qtCompileTest(wayland_egl) -qtCompileTest(brcm_egl) -qtCompileTest(glx) -qtCompileTest(xcomposite) -qtCompileTest(drm_egl_server) -qtCompileTest(libhybris_egl_server) - load(qt_parts) - -!config_wayland { - warning("QtWayland requires Wayland 1.6.0 or higher, QtWayland will not be built") - SUBDIRS = -} - -!config_xkbcommon { - warning("No xkbcommon 0.2.0 or higher found, disabling support for it") -} - -!config_wayland_scanner { - warning("QtWayland requires wayland-scanner, QtWayland will not be built") - SUBDIRS = -} - -!config_wayland_cursor { - warning("QtWayland requires wayland-cursor, QtWayland will not be built") - SUBDIRS = -} - -!config_wayland_egl { - message("no wayland-egl support detected, cross-toolkit compatibility disabled"); -} diff --git a/src/client/client.pro b/src/client/client.pro index 5ae01c04..749e3b6a 100644 --- a/src/client/client.pro +++ b/src/client/client.pro @@ -15,26 +15,17 @@ use_gold_linker: CONFIG += no_linker_version_script CONFIG -= precompile_header CONFIG += link_pkgconfig wayland-scanner -contains(QT_CONFIG, opengl) { +qtConfig(opengl) { DEFINES += QT_WAYLAND_GL_SUPPORT } -config_xkbcommon { - !contains(QT_CONFIG, no-pkg-config) { - PKGCONFIG_PRIVATE += xkbcommon - } else { - LIBS_PRIVATE += -lxkbcommon - } +qtConfig(xkbcommon-evdev) { + QMAKE_USE_PRIVATE += xkbcommon_evdev } else { DEFINES += QT_NO_WAYLAND_XKB } -!contains(QT_CONFIG, no-pkg-config) { - PKGCONFIG_PRIVATE += wayland-client wayland-cursor - contains(QT_CONFIG, glib): PKGCONFIG_PRIVATE += glib-2.0 -} else { - LIBS_PRIVATE += -lwayland-client -lwayland-cursor $$QT_LIBS_GLIB -} +QMAKE_USE += wayland-client wayland-cursor INCLUDEPATH += $$PWD/../shared diff --git a/src/client/configure.json b/src/client/configure.json new file mode 100644 index 00000000..b2a8fbc0 --- /dev/null +++ b/src/client/configure.json @@ -0,0 +1,134 @@ +{ + "module": "waylandclient", + "depends": [ + "gui-private" + ], + "testDir": "../../config.tests", + + "libraries": { + "wayland-client": { + "label": "Wayland client library", + "test": "wayland", + "sources": [ + { "type": "pkgConfig", "args": "wayland-client" }, + "-lwayland-client" + ] + }, + "wayland-cursor": { + "label": "Wayland cursor library", + "test": "wayland_cursor", + "use": "wayland-client", + "sources": [ + { "type": "pkgConfig", "args": "wayland-cursor" }, + "-lwayland-cursor" + ] + }, + "wayland-egl": { + "label": "Wayland EGL library", + "test": "wayland_egl", + "sources": [ + { "type": "pkgConfig", "args": "wayland-egl" }, + "-lwayland-egl" + ] + }, + "xcomposite": { + "label": "XComposite", + "test": "xcomposite", + "sources": [ + { "type": "pkgConfig", "args": "xcomposite" }, + "-lxcomposite" + ] + }, + "glx": { + "label": "GLX", + "test": "glx", + "sources": [ + { "type": "pkgConfig", "args": "x11 gl" }, + "-lX11 -lGl" + ] + } + }, + + "tests": { + "wayland-scanner": { + "label": "wayland-scanner", + "type": "compile", + "test": "wayland_scanner", + "use": "wayland-client" + }, + "drm-egl-server": { + "label": "DRM EGL Server", + "type": "compile", + "test": "drm_egl_server", + "use": "egl" + }, + "libhybris-egl-server": { + "label": "libhybris EGL Server", + "type": "compile", + "test": "libhybris_egl_server", + "use": "egl" + } + }, + + "features": { + "wayland-client": { + "label": "Qt Wayland Client", + "condition": "!config.win32 && libs.wayland-client && libs.wayland-cursor && tests.wayland-scanner", + "output": [ "privateFeature" ] + }, + "wayland-egl": { + "label": "EGL", + "condition": "features.wayland-client && features.opengl && features.egl && libs.wayland-egl", + "output": [ "privateFeature" ] + }, + "wayland-brcm": { + "label": "Rasberry Pi", + "condition": "features.wayland-client && features.eglfs_brcm", + "output": [ "privateFeature" ] + }, + "xcomposite-egl": { + "label": "XComposite EGL", + "condition": "features.wayland-client && features.opengl && features.egl && libs.xcomposite", + "output": [ "privateFeature" ] + }, + "xcomposite-glx": { + "label": "XComposite GLX", + "condition": "features.wayland-client && features.opengl && !features.opengles2 && libs.xcomposite && libs.glx", + "output": [ "privateFeature" ] + }, + "drm-egl-server": { + "label": "DRM EGL", + "condition": "features.wayland-client && features.opengl && features.egl && tests.drm-egl-server", + "output": [ "privateFeature" ] + }, + "libhybris-egl-server": { + "label": "libhybris EGL", + "condition": "features.wayland-client && features.opengl && features.egl && tests.libhybris-egl-server", + "output": [ "privateFeature" ] + } + }, + + "report": [ + { + "type": "note", + "condition": "!libs.wayland-egl", + "message": "No wayland-egl support detected. Cross-toolkit compatibility disabled." + } + ], + + "summary": [ + { + "section": "Qt Wayland Drivers", + "condition": "features.wayland-client", + "entries": [ + "wayland-egl", + "wayland-brcm", + "xcomposite-egl", + "xcomposite-glx", + "drm-egl-server", + "libhybris-egl-server" + ] + }, + "wayland-client" + ] +} diff --git a/src/compositor/compositor.pro b/src/compositor/compositor.pro index 251d757e..935fc252 100644 --- a/src/compositor/compositor.pro +++ b/src/compositor/compositor.pro @@ -5,19 +5,14 @@ QT = core gui-private qtHaveModule(quick): QT += quick -contains(QT_CONFIG, opengl):MODULE_DEFINES = QT_WAYLAND_COMPOSITOR_GL +qtConfig(opengl):MODULE_DEFINES = QT_WAYLAND_COMPOSITOR_GL CONFIG -= precompile_header CONFIG += link_pkgconfig -DEFINES += QT_WAYLAND_WINDOWMANAGER_SUPPORT QMAKE_DOCS = $$PWD/doc/qtwaylandcompositor.qdocconf -!contains(QT_CONFIG, no-pkg-config) { - PKGCONFIG_PRIVATE += wayland-server -} else { - LIBS += -lwayland-server -} +QMAKE_USE += wayland-server INCLUDEPATH += ../shared diff --git a/src/compositor/compositor_api/compositor_api.pri b/src/compositor/compositor_api/compositor_api.pri index 0253cd0e..1e9284c6 100644 --- a/src/compositor/compositor_api/compositor_api.pri +++ b/src/compositor/compositor_api/compositor_api.pri @@ -52,7 +52,7 @@ SOURCES += \ QT += core-private -qtHaveModule(quick):contains(QT_CONFIG, opengl) { +qtHaveModule(quick):qtConfig(opengl) { DEFINES += QT_WAYLAND_COMPOSITOR_QUICK SOURCES += \ diff --git a/src/compositor/configure.json b/src/compositor/configure.json new file mode 100644 index 00000000..2ddccd98 --- /dev/null +++ b/src/compositor/configure.json @@ -0,0 +1,99 @@ +{ + "module": "waylandcompositor", + "depends": [ + "gui-private" + ], + "testDir": "../../config.tests", + + "libraries": { + "wayland-server": { + "label": "wayland-server", + "test": "wayland", + "sources": [ + { "type": "pkgConfig", "args": "wayland-server" }, + "-lwayland-server" + ] + }, + "wayland-egl": { + "test": "wayland_egl", + "sources": [ + { "type": "pkgConfig", "args": "wayland-egl" }, + "-lwayland-egl" + ] + }, + "xcomposite": { + "test": "xcomposite", + "sources": [ + { "type": "pkgConfig", "args": "xcomposite" }, + "-lxcomposite" + ] + }, + "glx": { + "test": "glx", + "sources": [ + { "type": "pkgConfig", "args": "x11 gl" }, + "-lX11 -lGl" + ] + } + }, + + "tests": { + "wayland-scanner": { + "type": "compile", + "test": "wayland_scanner", + "use": "wayland-server" + }, + "drm-egl-server": { + "type": "compile", + "test": "drm_egl_server", + "use": "egl" + }, + "libhybris-egl-server": { + "type": "compile", + "test": "libhybris_egl_server", + "use": "egl" + } + }, + + "features": { + "wayland-server": { + "label": "Qt Wayland Compositor", + "condition": "!config.win32 && libs.wayland-server && tests.wayland-scanner", + "output": [ "privateFeature" ] + }, + "wayland-egl": { + "label": "EGL", + "condition": "features.wayland-server && features.opengl && features.egl && libs.wayland-egl", + "output": [ "privateFeature" ] + }, + "wayland-brcm": { + "label": "Rasberry Pi", + "condition": "features.wayland-server && features.eglfs_brcm", + "output": [ "privateFeature" ] + }, + "xcomposite-egl": { + "label": "XComposite EGL", + "condition": "features.wayland-server && features.egl && features.opengl && libs.xcomposite", + "output": [ "privateFeature" ] + }, + "xcomposite-glx": { + "label": "XComposite EGL", + "condition": "features.wayland-server && features.opengl && !features.opengles2 && libs.xcomposite && libs.glx", + "output": [ "privateFeature" ] + }, + "drm-egl-server": { + "label": "DRM EGL", + "condition": "features.wayland-server && features.opengl && features.egl && tests.drm-egl-server", + "output": [ "privateFeature" ] + }, + "libhybris-egl-server": { + "label": "libhybris EGL", + "condition": "features.wayland-server && features.opengl && features.egl && tests.libhybris-egl-server", + "output": [ "privateFeature" ] + } + }, + + "summary": [ + "wayland-server" + ] +} diff --git a/src/compositor/wayland_wrapper/wayland_wrapper.pri b/src/compositor/wayland_wrapper/wayland_wrapper.pri index fa5d7629..38830340 100644 --- a/src/compositor/wayland_wrapper/wayland_wrapper.pri +++ b/src/compositor/wayland_wrapper/wayland_wrapper.pri @@ -24,12 +24,8 @@ SOURCES += \ INCLUDEPATH += wayland_wrapper -config_xkbcommon { - !contains(QT_CONFIG, no-pkg-config) { - PKGCONFIG_PRIVATE += xkbcommon - } else { - LIBS_PRIVATE += -lxkbcommon - } +qtConfig(xkbcommon-evdev) { + QMAKE_USE += xkbcommon_evdev } else { DEFINES += QT_NO_WAYLAND_XKB } diff --git a/src/hardwareintegration/client/brcm-egl/brcm-egl.pri b/src/hardwareintegration/client/brcm-egl/brcm-egl.pri index e4fd68f3..64cb4467 100644 --- a/src/hardwareintegration/client/brcm-egl/brcm-egl.pri +++ b/src/hardwareintegration/client/brcm-egl/brcm-egl.pri @@ -1,13 +1,6 @@ INCLUDEPATH += $$PWD -contains(QT_CONFIG, no-pkg-config) { - CONFIG += link_pkgconfig - PKGCONFIG += wayland-client -} else { - LIBS += -lwayland-client -} - -CONFIG += egl +QMAKE_USE += egl wayland-client QT += egl_support-private SOURCES += $$PWD/qwaylandbrcmeglintegration.cpp \ diff --git a/src/hardwareintegration/client/drm-egl-server/drm-egl-server.pri b/src/hardwareintegration/client/drm-egl-server/drm-egl-server.pri index c3d592a9..700e95e3 100644 --- a/src/hardwareintegration/client/drm-egl-server/drm-egl-server.pri +++ b/src/hardwareintegration/client/drm-egl-server/drm-egl-server.pri @@ -1,13 +1,6 @@ INCLUDEPATH += $$PWD -contains(QT_CONFIG, no-pkg-config) { - LIBS += -lwayland-client -} else { - CONFIG += link_pkgconfig - PKGCONFIG += wayland-client -} - -CONFIG += egl +QMAKE_USE += egl wayland-client SOURCES += \ $$PWD/drmeglserverbufferintegration.cpp diff --git a/src/hardwareintegration/client/libhybris-egl-server/libhybris-egl-server.pri b/src/hardwareintegration/client/libhybris-egl-server/libhybris-egl-server.pri index 55e0ffd2..bc821574 100644 --- a/src/hardwareintegration/client/libhybris-egl-server/libhybris-egl-server.pri +++ b/src/hardwareintegration/client/libhybris-egl-server/libhybris-egl-server.pri @@ -1,11 +1,6 @@ INCLUDEPATH += $$PWD -contains(QT_CONFIG, no-pkg-config) { - LIBS += -lEGL -lwayland-client -} else { - CONFIG += link_pkgconfig - PKGCONFIG += egl wayland-client -} +QMAKE_USE += egl wayland-client SOURCES += \ $$PWD/libhybriseglserverbufferintegration.cpp diff --git a/src/hardwareintegration/client/wayland-egl/wayland-egl.pri b/src/hardwareintegration/client/wayland-egl/wayland-egl.pri index 276b7b54..f812144a 100644 --- a/src/hardwareintegration/client/wayland-egl/wayland-egl.pri +++ b/src/hardwareintegration/client/wayland-egl/wayland-egl.pri @@ -1,13 +1,8 @@ INCLUDEPATH += $$PWD -!contains(QT_CONFIG, no-pkg-config) { - CONFIG += link_pkgconfig - PKGCONFIG += wayland-client wayland-egl -} else { - LIBS += -lwayland-client -lwayland-egl -} + +QMAKE_USE += egl wayland-client wayland-egl DEFINES += QT_EGL_WAYLAND -CONFIG += egl QT += egl_support-private SOURCES += $$PWD/qwaylandeglclientbufferintegration.cpp \ diff --git a/src/hardwareintegration/client/xcomposite-egl/xcomposite-egl.pri b/src/hardwareintegration/client/xcomposite-egl/xcomposite-egl.pri index 3a5fcb54..f2beb1e0 100644 --- a/src/hardwareintegration/client/xcomposite-egl/xcomposite-egl.pri +++ b/src/hardwareintegration/client/xcomposite-egl/xcomposite-egl.pri @@ -1,15 +1,9 @@ INCLUDEPATH += $$PWD include($$PWD/../xcomposite_share/xcomposite_share.pri) -!contains(QT_CONFIG, no-pkg-config) { - CONFIG += link_pkgconfig - PKGCONFIG += wayland-client xcomposite x11 -} else { - LIBS += -lXcomposite -lX11 -} +QMAKE_USE += egl wayland-client QT += egl_support-private -CONFIG += egl SOURCES += \ $$PWD/qwaylandxcompositeeglcontext.cpp \ diff --git a/src/hardwareintegration/client/xcomposite-glx/xcomposite-glx.pri b/src/hardwareintegration/client/xcomposite-glx/xcomposite-glx.pri index bc072bf0..067378af 100644 --- a/src/hardwareintegration/client/xcomposite-glx/xcomposite-glx.pri +++ b/src/hardwareintegration/client/xcomposite-glx/xcomposite-glx.pri @@ -1,12 +1,7 @@ INCLUDEPATH += $$PWD include ($$PWD/../xcomposite_share/xcomposite_share.pri) -!contains(QT_CONFIG, no-pkg-config) { - CONFIG += link_pkgconfig - PKGCONFIG += wayland-client xcomposite gl x11 -} else { - LIBS += -lXcomposite -lGL -lX11 -} +QMAKE_USE += wayland-client glx QT += glx_support-private diff --git a/src/hardwareintegration/client/xcomposite_share/xcomposite_share.pri b/src/hardwareintegration/client/xcomposite_share/xcomposite_share.pri index be3c9fc1..f255f5c5 100644 --- a/src/hardwareintegration/client/xcomposite_share/xcomposite_share.pri +++ b/src/hardwareintegration/client/xcomposite_share/xcomposite_share.pri @@ -1,5 +1,6 @@ INCLUDEPATH += $$PWD +QMAKE_USE += xcomposite CONFIG += wayland-scanner WAYLANDCLIENTSOURCES += $$PWD/../../../extensions/xcomposite.xml diff --git a/src/hardwareintegration/compositor/brcm-egl/brcm-egl.pri b/src/hardwareintegration/compositor/brcm-egl/brcm-egl.pri index f4780710..2658e84b 100644 --- a/src/hardwareintegration/compositor/brcm-egl/brcm-egl.pri +++ b/src/hardwareintegration/compositor/brcm-egl/brcm-egl.pri @@ -4,12 +4,7 @@ INCLUDEPATH += $$PWD DEFINES += QT_NO_OPENGL_ES_3 -!contains(QT_CONFIG, no-pkg-config) { - CONFIG += link_pkgconfig - PKGCONFIG += wayland-server -} else { - LIBS += -lwayland-server -} +QMAKE_USE_PRIVATE += wayland-server for(p, QMAKE_LIBDIR_EGL) { exists($$p):LIBS += -L$$p diff --git a/src/hardwareintegration/compositor/drm-egl-server/drm-egl-server.pri b/src/hardwareintegration/compositor/drm-egl-server/drm-egl-server.pri index 2ed5db68..7d684174 100644 --- a/src/hardwareintegration/compositor/drm-egl-server/drm-egl-server.pri +++ b/src/hardwareintegration/compositor/drm-egl-server/drm-egl-server.pri @@ -1,13 +1,6 @@ INCLUDEPATH += $$PWD -contains(QT_CONFIG, no-pkg-config) { - LIBS += -lwayland-server -} else { - CONFIG += link_pkgconfig - PKGCONFIG += wayland-server -} - -CONFIG += egl +QMAKE_USE_PRIVATE += egl wayland-server SOURCES += \ $$PWD/drmeglserverbufferintegration.cpp diff --git a/src/hardwareintegration/compositor/libhybris-egl-server/libhybris-egl-server.pri b/src/hardwareintegration/compositor/libhybris-egl-server/libhybris-egl-server.pri index 5cbcb6b7..125be9c5 100644 --- a/src/hardwareintegration/compositor/libhybris-egl-server/libhybris-egl-server.pri +++ b/src/hardwareintegration/compositor/libhybris-egl-server/libhybris-egl-server.pri @@ -1,13 +1,6 @@ INCLUDEPATH += $$PWD -contains(QT_CONFIG, no-pkg-config) { - LIBS += -lwayland-server -} else { - CONFIG += link_pkgconfig - PKGCONFIG += wayland-server -} - -CONFIG += egl +QMAKE_USE_PRIVATE += egl wayland-server SOURCES += \ $$PWD/libhybriseglserverbufferintegration.cpp diff --git a/src/hardwareintegration/compositor/wayland-egl/wayland-egl.pri b/src/hardwareintegration/compositor/wayland-egl/wayland-egl.pri index f3647489..df3aead3 100644 --- a/src/hardwareintegration/compositor/wayland-egl/wayland-egl.pri +++ b/src/hardwareintegration/compositor/wayland-egl/wayland-egl.pri @@ -1,13 +1,7 @@ INCLUDEPATH += $$PWD -!contains(QT_CONFIG, no-pkg-config) { - CONFIG += link_pkgconfig - PKGCONFIG += wayland-server wayland-egl -} else { - LIBS += -lwayland-egl -lwayland-server -} +QMAKE_USE_PRIVATE += wayland-server wayland-egl -CONFIG += egl QT += egl_support-private SOURCES += \ diff --git a/src/hardwareintegration/compositor/xcomposite-egl/xcomposite-egl.pri b/src/hardwareintegration/compositor/xcomposite-egl/xcomposite-egl.pri index d748c2b5..6d0f8165 100644 --- a/src/hardwareintegration/compositor/xcomposite-egl/xcomposite-egl.pri +++ b/src/hardwareintegration/compositor/xcomposite-egl/xcomposite-egl.pri @@ -1,13 +1,6 @@ include($$PWD/../xcomposite_share/xcomposite_share.pri) -!contains(QT_CONFIG, no-pkg-config) { - CONFIG += link_pkgconfig - PKGCONFIG += xcomposite x11 wayland-server -} else { - LIBS += -lXcomposite -lX11 -} - -CONFIG += egl +QMAKE_USE_PRIVATE += egl wayland-server x11 INCLUDEPATH += $$PWD diff --git a/src/hardwareintegration/compositor/xcomposite-glx/xcomposite-glx.pri b/src/hardwareintegration/compositor/xcomposite-glx/xcomposite-glx.pri index ccbbe46a..423ae181 100644 --- a/src/hardwareintegration/compositor/xcomposite-glx/xcomposite-glx.pri +++ b/src/hardwareintegration/compositor/xcomposite-glx/xcomposite-glx.pri @@ -1,11 +1,6 @@ include($$PWD/../xcomposite_share/xcomposite_share.pri) -!contains(QT_CONFIG, no-pkg-config) { - CONFIG += link_pkgconfig - PKGCONFIG += xcomposite gl x11 wayland-server -} else { - LIBS += -lXcomposite -lGL -lX11 -} +QMAKE_USE_PRIVATE += wayland-server glx INCLUDEPATH += $$PWD diff --git a/src/hardwareintegration/compositor/xcomposite_share/xcomposite_share.pri b/src/hardwareintegration/compositor/xcomposite_share/xcomposite_share.pri index 06937c41..69ab6aa1 100644 --- a/src/hardwareintegration/compositor/xcomposite_share/xcomposite_share.pri +++ b/src/hardwareintegration/compositor/xcomposite_share/xcomposite_share.pri @@ -1,5 +1,6 @@ INCLUDEPATH += $$PWD +QMAKE_USE += xcomposite CONFIG += wayland-scanner WAYLANDSERVERSOURCES += $$PWD/../../../extensions/xcomposite.xml $$PWD/../../../3rdparty/protocol/wayland.xml diff --git a/src/plugins/decorations/bradient/bradient.pro b/src/plugins/decorations/bradient/bradient.pro index 0f62db9c..843149e0 100644 --- a/src/plugins/decorations/bradient/bradient.pro +++ b/src/plugins/decorations/bradient/bradient.pro @@ -5,12 +5,7 @@ OTHER_FILES += \ SOURCES += main.cpp -contains(QT_CONFIG, no-pkg-config) { - LIBS += -lwayland-client -} else { - CONFIG += link_pkgconfig - PKGCONFIG += wayland-client -} +QMAKE_USE += wayland-client PLUGIN_TYPE = wayland-decoration-client load(qt_plugin) diff --git a/src/plugins/hardwareintegration/client/client.pro b/src/plugins/hardwareintegration/client/client.pro index 37a90ab0..a5967c71 100644 --- a/src/plugins/hardwareintegration/client/client.pro +++ b/src/plugins/hardwareintegration/client/client.pro @@ -1,21 +1,15 @@ TEMPLATE=subdirs +QT_FOR_CONFIG += waylandclient-private -config_wayland_egl: \ +qtConfig(wayland-egl): \ SUBDIRS += wayland-egl - -config_brcm_egl: \ +qtConfig(wayland-brcm): \ SUBDIRS += brcm-egl - -config_xcomposite { - contains(QT_CONFIG, egl): \ - SUBDIRS += xcomposite-egl - - !contains(QT_CONFIG, opengles2):config_glx: \ - SUBDIRS += xcomposite-glx -} - -config_drm_egl_server: \ +qtConfig(xcomposite-egl): \ + SUBDIRS += xcomposite-egl +qtConfig(xcomposite-glx): \ + SUBDIRS += xcomposite-glx +qtConfig(drm-egl-server): \ SUBDIRS += drm-egl-server - -config_libhybris_egl_server: \ +qtConfig(libhybris-egl-server): \ SUBDIRS += libhybris-egl-server diff --git a/src/plugins/hardwareintegration/compositor/compositor.pro b/src/plugins/hardwareintegration/compositor/compositor.pro index 1ecfe37a..29911625 100644 --- a/src/plugins/hardwareintegration/compositor/compositor.pro +++ b/src/plugins/hardwareintegration/compositor/compositor.pro @@ -1,20 +1,15 @@ TEMPLATE = subdirs +QT_FOR_CONFIG += waylandcompositor-private -config_wayland_egl: \ +qtConfig(wayland-egl): \ SUBDIRS += wayland-egl -config_brcm_egl: \ +qtConfig(wayland-brcm): \ SUBDIRS += brcm-egl - -config_xcomposite { - contains(QT_CONFIG, egl): \ - SUBDIRS += xcomposite-egl - - !contains(QT_CONFIG, opengles2):config_glx: \ - SUBDIRS += xcomposite-glx -} - -config_drm_egl_server: \ +qtConfig(xcomposite-egl): \ + SUBDIRS += xcomposite-egl +qtConfig(xcomposite-glx): \ + SUBDIRS += xcomposite-glx +qtConfig(drm-egl-server): \ SUBDIRS += drm-egl-server - -config_libhybris_egl_server: \ +qtConfig(libhybris-egl-server): \ SUBDIRS += libhybris-egl-server diff --git a/src/plugins/platforms/platforms.pro b/src/plugins/platforms/platforms.pro index 4bee8929..ec589ae8 100644 --- a/src/plugins/platforms/platforms.pro +++ b/src/plugins/platforms/platforms.pro @@ -1,19 +1,17 @@ TEMPLATE=subdirs CONFIG+=ordered +QT_FOR_CONFIG += waylandclient-private SUBDIRS += qwayland-generic -config_wayland_egl { +qtConfig(wayland-egl): \ SUBDIRS += qwayland-egl -} #The following integrations are only useful with QtWaylandCompositor -config_brcm_egl: \ +qtConfig(wayland-brcm): \ SUBDIRS += qwayland-brcm-egl -config_xcomposite { - contains(QT_CONFIG, egl): \ - SUBDIRS += qwayland-xcomposite-egl - !contains(QT_CONFIG, opengles2):config_glx: \ - SUBDIRS += qwayland-xcomposite-glx -} +qtConfig(xcomposite-egl): \ + SUBDIRS += qwayland-xcomposite-egl +qtConfig(xcomposite-glx): \ + SUBDIRS += qwayland-xcomposite-glx diff --git a/src/plugins/shellintegration/ivi-shell/ivi-shell.pro b/src/plugins/shellintegration/ivi-shell/ivi-shell.pro index 8fd77473..d254b9fc 100644 --- a/src/plugins/shellintegration/ivi-shell/ivi-shell.pro +++ b/src/plugins/shellintegration/ivi-shell/ivi-shell.pro @@ -1,22 +1,13 @@ PLUGIN_TYPE = wayland-shell-integration load(qt_plugin) -QT += waylandclient-private +QT += gui-private waylandclient-private CONFIG += wayland-scanner -!contains(QT_CONFIG, no-pkg-config) { - PKGCONFIG += wayland-client wayland-cursor - CONFIG += link_pkgconfig -} else { - LIBS += -lwayland-client -lwayland-cursor -} +QMAKE_USE += wayland-client -config_xkbcommon { - !contains(QT_CONFIG, no-pkg-config) { - PKGCONFIG += xkbcommon - } else { - LIBS += -lxkbcommon - } +qtConfig(xkbcommon-evdev) { + QMAKE_USE += xkbcommon_evdev } else { DEFINES += QT_NO_WAYLAND_XKB } diff --git a/src/src.pro b/src/src.pro index bf5ffe36..4ecbc71b 100644 --- a/src/src.pro +++ b/src/src.pro @@ -1,25 +1,33 @@ TEMPLATE=subdirs +include($$OUT_PWD/client/qtwaylandclient-config.pri) +include($$OUT_PWD/compositor/qtwaylandcompositor-config.pri) +QT_FOR_CONFIG += waylandclient-private waylandcompositor-private -sub_qtwaylandscanner.subdir = qtwaylandscanner -sub_qtwaylandscanner.target = sub-qtwaylandscanner -SUBDIRS += sub_qtwaylandscanner +qtConfig(wayland-client) { + sub_qtwaylandscanner.subdir = qtwaylandscanner + sub_qtwaylandscanner.target = sub-qtwaylandscanner + SUBDIRS += sub_qtwaylandscanner -sub_compositor.subdir = compositor -sub_compositor.depends = sub-qtwaylandscanner -sub_compositor.target = sub-compositor -SUBDIRS += sub_compositor + sub_client.subdir = client + sub_client.depends = sub-qtwaylandscanner + sub_client.target = sub-client + SUBDIRS += sub_client -sub_imports.subdir = imports -sub_imports.depends += sub-compositor -sub_imports.target = sub-imports -SUBDIRS += sub_imports + qtConfig(wayland-server) { + sub_compositor.subdir = compositor + sub_compositor.depends = sub-qtwaylandscanner + sub_compositor.target = sub-compositor + SUBDIRS += sub_compositor -sub_client.subdir = client -sub_client.depends = sub-qtwaylandscanner -sub_client.target = sub-client -SUBDIRS += sub_client + sub_imports.subdir = imports + sub_imports.depends += sub-compositor + sub_imports.target = sub-imports + SUBDIRS += sub_imports + + sub_plugins.subdir = plugins + sub_plugins.depends = sub-qtwaylandscanner sub-client sub-compositor + sub_plugins.target = sub-plugins + SUBDIRS += sub_plugins + } +} -sub_plugins.subdir = plugins -sub_plugins.depends = sub-qtwaylandscanner sub-client sub-compositor -sub_plugins.target = sub-plugins -SUBDIRS += sub_plugins diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro index a704c732..79ad29bd 100644 --- a/tests/auto/auto.pro +++ b/tests/auto/auto.pro @@ -1,5 +1,7 @@ TEMPLATE=subdirs +QT_FOR_CONFIG += waylandclient-private -SUBDIRS += client -SUBDIRS += cmake -SUBDIRS += compositor +qtConfig(wayland-client): \ + SUBDIRS += client cmake +qtHaveModule(waylandcompositor): \ + SUBDIRS += compositor diff --git a/tests/auto/client/client/client.pro b/tests/auto/client/client/client.pro index 006d130a..34fc6747 100644 --- a/tests/auto/client/client/client.pro +++ b/tests/auto/client/client/client.pro @@ -4,11 +4,7 @@ TARGET = tst_client QT += testlib QT += core-private gui-private -!contains(QT_CONFIG, no-pkg-config) { - PKGCONFIG += wayland-client wayland-server -} else { - LIBS += -lwayland-client -lwayland-server -} +QMAKE_USE += wayland-client wayland-server CONFIG += wayland-scanner WAYLANDSERVERSOURCES += \ diff --git a/tests/auto/compositor/compositor/compositor.pro b/tests/auto/compositor/compositor/compositor.pro index 1d4456f6..c0b91963 100644 --- a/tests/auto/compositor/compositor/compositor.pro +++ b/tests/auto/compositor/compositor/compositor.pro @@ -5,18 +5,10 @@ TARGET = tst_compositor QT += testlib QT += core-private gui-private waylandcompositor waylandcompositor-private -!contains(QT_CONFIG, no-pkg-config) { - PKGCONFIG += wayland-client wayland-server -} else { - LIBS += -lwayland-client -lwayland-server -} +QMAKE_USE += wayland-client wayland-server -config_xkbcommon { - !contains(QT_CONFIG, no-pkg-config) { - PKGCONFIG_PRIVATE += xkbcommon - } else { - LIBS_PRIVATE += -lxkbcommon - } +qtConfig(xkbcommon-evdev) { + QMAKE_USE += xkbcommon_evdev } else { DEFINES += QT_NO_WAYLAND_XKB } -- cgit v1.2.1 From 2333c58fff009435503c3b7ef3d86569227056eb Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Tue, 15 Nov 2016 15:59:13 +0100 Subject: Use the feature system internally Get rid of almost all DEFINES += ... in the pro files, instead use the proper QT_CONFIG() macro to determine whether a feature is available. Change-Id: I867769be2085c6ba93b6815e223e2b89edcb245d Reviewed-by: Paul Olav Tvete --- src/client/client.pro | 12 +--- src/client/global/qwaylandclientextension.h | 2 +- .../qwaylandclientbufferintegration_p.h | 2 +- .../qwaylandclientbufferintegrationfactory_p.h | 2 +- .../qwaylandclientbufferintegrationplugin_p.h | 2 +- .../qwaylandhardwareintegration_p.h | 2 +- .../qwaylandserverbufferintegration_p.h | 2 +- .../qwaylandserverbufferintegrationfactory_p.h | 2 +- .../qwaylandserverbufferintegrationplugin_p.h | 2 +- .../qwaylandinputdeviceintegration_p.h | 2 +- .../qwaylandinputdeviceintegrationfactory_p.h | 2 +- .../qwaylandinputdeviceintegrationplugin_p.h | 2 +- src/client/qtwaylandclientglobal.h | 70 +++++++++++++++++++++ src/client/qtwaylandclientglobal_p.h | 59 ++++++++++++++++++ src/client/qwaylandabstractdecoration_p.h | 2 +- src/client/qwaylandbuffer_p.h | 2 +- src/client/qwaylandclientexport.h | 69 --------------------- src/client/qwaylandclipboard_p.h | 2 +- src/client/qwaylandcursor_p.h | 2 +- src/client/qwaylanddatadevicemanager_p.h | 2 +- src/client/qwaylanddataoffer_p.h | 2 +- src/client/qwaylanddatasource_p.h | 2 +- src/client/qwaylanddecorationfactory_p.h | 2 +- src/client/qwaylanddecorationplugin_p.h | 2 +- src/client/qwaylanddisplay_p.h | 2 +- src/client/qwaylanddnd_p.h | 2 +- src/client/qwaylandextendedsurface_p.h | 2 +- src/client/qwaylandinputdevice.cpp | 22 +++---- src/client/qwaylandinputdevice_p.h | 9 +-- src/client/qwaylandintegration_p.h | 3 +- src/client/qwaylandnativeinterface.cpp | 2 +- src/client/qwaylandnativeinterface_p.h | 2 +- src/client/qwaylandqtkey_p.h | 2 +- src/client/qwaylandscreen_p.h | 2 +- src/client/qwaylandshellsurface_p.h | 2 +- src/client/qwaylandshm_p.h | 2 +- src/client/qwaylandsubsurface_p.h | 2 +- src/client/qwaylandtouch_p.h | 2 +- src/client/qwaylandwindow_p.h | 2 +- src/client/qwaylandwindowmanagerintegration_p.h | 2 +- src/client/qwaylandwlshellsurface_p.h | 2 +- src/client/qwaylandxdgpopup_p.h | 2 +- src/client/qwaylandxdgshell_p.h | 2 +- src/client/qwaylandxdgsurface_p.h | 2 +- .../shellintegration/qwaylandshellintegration_p.h | 3 +- .../qwaylandshellintegrationfactory_p.h | 2 +- .../qwaylandshellintegrationplugin_p.h | 2 +- src/compositor/compositor.pro | 2 - .../compositor_api/qwaylandbufferref.cpp | 2 +- src/compositor/compositor_api/qwaylandbufferref.h | 7 ++- src/compositor/compositor_api/qwaylandclient.h | 2 +- .../compositor_api/qwaylandcompositor.cpp | 21 ++++--- src/compositor/compositor_api/qwaylandcompositor.h | 2 +- .../compositor_api/qwaylandcompositor_p.h | 8 +-- .../compositor_api/qwaylanddestroylistener.h | 2 +- src/compositor/compositor_api/qwaylanddrag.h | 2 +- .../compositor_api/qwaylandinputmethodcontrol_p.h | 2 +- src/compositor/compositor_api/qwaylandkeyboard.cpp | 17 ++--- src/compositor/compositor_api/qwaylandkeyboard_p.h | 10 +-- src/compositor/compositor_api/qwaylandkeymap.h | 2 +- src/compositor/compositor_api/qwaylandoutput_p.h | 2 +- src/compositor/compositor_api/qwaylandoutputmode.h | 2 +- src/compositor/compositor_api/qwaylandpointer_p.h | 2 +- src/compositor/compositor_api/qwaylandquickitem.h | 2 +- src/compositor/compositor_api/qwaylandresource.h | 2 +- src/compositor/compositor_api/qwaylandseat.h | 2 +- src/compositor/compositor_api/qwaylandseat_p.h | 6 +- src/compositor/compositor_api/qwaylandsurface.h | 2 +- src/compositor/compositor_api/qwaylandsurface_p.h | 2 +- .../compositor_api/qwaylandsurfacegrabber.h | 2 +- src/compositor/compositor_api/qwaylandtouch_p.h | 2 +- src/compositor/compositor_api/qwaylandview.h | 2 +- src/compositor/extensions/qwaylandwlshell_p.h | 2 +- src/compositor/global/global.pri | 2 +- src/compositor/global/qtwaylandcompositorglobal.h | 72 ++++++++++++++++++++++ .../global/qtwaylandcompositorglobal_p.h | 59 ++++++++++++++++++ .../global/qwaylandcompositorextension.h | 2 +- src/compositor/global/qwaylandexport.h | 56 ----------------- .../hardware_integration/hardware_integration.pri | 4 +- .../qwlclientbufferintegration_p.h | 2 +- .../qwlclientbufferintegrationfactory_p.h | 2 +- .../qwlclientbufferintegrationplugin_p.h | 2 +- .../qwlserverbufferintegration_p.h | 2 +- .../qwlserverbufferintegrationfactory_p.h | 2 +- .../qwlserverbufferintegrationplugin_p.h | 2 +- src/compositor/wayland_wrapper/qwlclientbuffer.cpp | 4 +- src/compositor/wayland_wrapper/qwlclientbuffer_p.h | 4 +- src/compositor/wayland_wrapper/qwlregion_p.h | 2 +- src/compositor/wayland_wrapper/wayland_wrapper.pri | 5 +- .../client/wayland-egl/wayland-egl.pri | 1 - .../compositor/brcm-egl/brcm-egl.pri | 2 - src/imports/compositor/qwaylandmousetracker_p.h | 2 +- .../compositor/qwaylandquickcompositorplugin.cpp | 2 +- .../shellintegration/ivi-shell/ivi-shell.pro | 5 +- src/shared/qwaylandxkb.cpp | 4 -- src/shared/qwaylandxkb_p.h | 4 -- sync.profile | 6 ++ tests/auto/compositor/compositor/compositor.pro | 5 +- 98 files changed, 398 insertions(+), 289 deletions(-) create mode 100644 src/client/qtwaylandclientglobal.h create mode 100644 src/client/qtwaylandclientglobal_p.h delete mode 100644 src/client/qwaylandclientexport.h create mode 100644 src/compositor/global/qtwaylandcompositorglobal.h create mode 100644 src/compositor/global/qtwaylandcompositorglobal_p.h delete mode 100644 src/compositor/global/qwaylandexport.h diff --git a/src/client/client.pro b/src/client/client.pro index 749e3b6a..7482cfd6 100644 --- a/src/client/client.pro +++ b/src/client/client.pro @@ -15,15 +15,8 @@ use_gold_linker: CONFIG += no_linker_version_script CONFIG -= precompile_header CONFIG += link_pkgconfig wayland-scanner -qtConfig(opengl) { - DEFINES += QT_WAYLAND_GL_SUPPORT -} - -qtConfig(xkbcommon-evdev) { +qtConfig(xkbcommon-evdev): \ QMAKE_USE_PRIVATE += xkbcommon_evdev -} else { - DEFINES += QT_NO_WAYLAND_XKB -} QMAKE_USE += wayland-client wayland-cursor @@ -108,7 +101,8 @@ HEADERS += qwaylandintegration_p.h \ qwaylandinputcontext_p.h \ qwaylanddatadevice_p.h \ qwaylandshm_p.h \ - qwaylandclientexport.h \ + qtwaylandclientglobal.h \ + qtwaylandclientglobal_p.h \ ../shared/qwaylandinputmethodeventbuilder_p.h \ ../shared/qwaylandmimehelper_p.h \ ../shared/qwaylandxkb_p.h \ diff --git a/src/client/global/qwaylandclientextension.h b/src/client/global/qwaylandclientextension.h index d1610c27..37345202 100644 --- a/src/client/global/qwaylandclientextension.h +++ b/src/client/global/qwaylandclientextension.h @@ -38,7 +38,7 @@ #define QWAYLANDCLIENTEXTENSION_H #include -#include +#include struct wl_registry; diff --git a/src/client/hardwareintegration/qwaylandclientbufferintegration_p.h b/src/client/hardwareintegration/qwaylandclientbufferintegration_p.h index adaf2902..f1f0cf93 100644 --- a/src/client/hardwareintegration/qwaylandclientbufferintegration_p.h +++ b/src/client/hardwareintegration/qwaylandclientbufferintegration_p.h @@ -52,7 +52,7 @@ // #include -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/client/hardwareintegration/qwaylandclientbufferintegrationfactory_p.h b/src/client/hardwareintegration/qwaylandclientbufferintegrationfactory_p.h index c70a2bd5..7eaeed16 100644 --- a/src/client/hardwareintegration/qwaylandclientbufferintegrationfactory_p.h +++ b/src/client/hardwareintegration/qwaylandclientbufferintegrationfactory_p.h @@ -51,7 +51,7 @@ // We mean it. // -#include +#include #include QT_BEGIN_NAMESPACE diff --git a/src/client/hardwareintegration/qwaylandclientbufferintegrationplugin_p.h b/src/client/hardwareintegration/qwaylandclientbufferintegrationplugin_p.h index 2830f95f..6496b33e 100644 --- a/src/client/hardwareintegration/qwaylandclientbufferintegrationplugin_p.h +++ b/src/client/hardwareintegration/qwaylandclientbufferintegrationplugin_p.h @@ -51,7 +51,7 @@ // We mean it. // -#include +#include #include #include diff --git a/src/client/hardwareintegration/qwaylandhardwareintegration_p.h b/src/client/hardwareintegration/qwaylandhardwareintegration_p.h index db9e19ac..8b4a7162 100644 --- a/src/client/hardwareintegration/qwaylandhardwareintegration_p.h +++ b/src/client/hardwareintegration/qwaylandhardwareintegration_p.h @@ -52,7 +52,7 @@ // #include -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/client/hardwareintegration/qwaylandserverbufferintegration_p.h b/src/client/hardwareintegration/qwaylandserverbufferintegration_p.h index e3943da8..67f857db 100644 --- a/src/client/hardwareintegration/qwaylandserverbufferintegration_p.h +++ b/src/client/hardwareintegration/qwaylandserverbufferintegration_p.h @@ -55,7 +55,7 @@ #include #include -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/client/hardwareintegration/qwaylandserverbufferintegrationfactory_p.h b/src/client/hardwareintegration/qwaylandserverbufferintegrationfactory_p.h index f1785620..600c24c9 100644 --- a/src/client/hardwareintegration/qwaylandserverbufferintegrationfactory_p.h +++ b/src/client/hardwareintegration/qwaylandserverbufferintegrationfactory_p.h @@ -51,7 +51,7 @@ // We mean it. // -#include +#include #include QT_BEGIN_NAMESPACE diff --git a/src/client/hardwareintegration/qwaylandserverbufferintegrationplugin_p.h b/src/client/hardwareintegration/qwaylandserverbufferintegrationplugin_p.h index 7eaaa170..b3ed3ccc 100644 --- a/src/client/hardwareintegration/qwaylandserverbufferintegrationplugin_p.h +++ b/src/client/hardwareintegration/qwaylandserverbufferintegrationplugin_p.h @@ -51,7 +51,7 @@ // We mean it. // -#include +#include #include #include diff --git a/src/client/inputdeviceintegration/qwaylandinputdeviceintegration_p.h b/src/client/inputdeviceintegration/qwaylandinputdeviceintegration_p.h index ada63b71..1fa0fd6d 100644 --- a/src/client/inputdeviceintegration/qwaylandinputdeviceintegration_p.h +++ b/src/client/inputdeviceintegration/qwaylandinputdeviceintegration_p.h @@ -52,7 +52,7 @@ // #include -#include +#include #include diff --git a/src/client/inputdeviceintegration/qwaylandinputdeviceintegrationfactory_p.h b/src/client/inputdeviceintegration/qwaylandinputdeviceintegrationfactory_p.h index d6d0e843..80096e79 100644 --- a/src/client/inputdeviceintegration/qwaylandinputdeviceintegrationfactory_p.h +++ b/src/client/inputdeviceintegration/qwaylandinputdeviceintegrationfactory_p.h @@ -51,7 +51,7 @@ // We mean it. // -#include +#include #include QT_BEGIN_NAMESPACE diff --git a/src/client/inputdeviceintegration/qwaylandinputdeviceintegrationplugin_p.h b/src/client/inputdeviceintegration/qwaylandinputdeviceintegrationplugin_p.h index c4a578d2..2d9961db 100644 --- a/src/client/inputdeviceintegration/qwaylandinputdeviceintegrationplugin_p.h +++ b/src/client/inputdeviceintegration/qwaylandinputdeviceintegrationplugin_p.h @@ -51,7 +51,7 @@ // We mean it. // -#include +#include #include #include diff --git a/src/client/qtwaylandclientglobal.h b/src/client/qtwaylandclientglobal.h new file mode 100644 index 00000000..5f474f37 --- /dev/null +++ b/src/client/qtwaylandclientglobal.h @@ -0,0 +1,70 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QWAYLANDCLIENTGLOBAL_H +#define QWAYLANDCLIENTGLOBAL_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include +#include + +QT_BEGIN_NAMESPACE + +#if !defined(Q_WAYLAND_CLIENT_EXPORT) +# if defined(QT_SHARED) +# define Q_WAYLAND_CLIENT_EXPORT Q_DECL_EXPORT +# else +# define Q_WAYLAND_CLIENT_EXPORT +# endif +#endif + +QT_END_NAMESPACE + +#endif //QWAYLANDCLIENTGLOBAL_H + diff --git a/src/client/qtwaylandclientglobal_p.h b/src/client/qtwaylandclientglobal_p.h new file mode 100644 index 00000000..f2106d0b --- /dev/null +++ b/src/client/qtwaylandclientglobal_p.h @@ -0,0 +1,59 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QWAYLANDCLIENTGLOBAL_P_H +#define QWAYLANDCLIENTGLOBAL_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include +#include +#include + +#endif //QWAYLANDCLIENTGLOBAL_P_H + diff --git a/src/client/qwaylandabstractdecoration_p.h b/src/client/qwaylandabstractdecoration_p.h index 3220dab9..42c65be6 100644 --- a/src/client/qwaylandabstractdecoration_p.h +++ b/src/client/qwaylandabstractdecoration_p.h @@ -59,7 +59,7 @@ #include #include #include -#include +#include #include diff --git a/src/client/qwaylandbuffer_p.h b/src/client/qwaylandbuffer_p.h index 8d651f82..9e8cba2e 100644 --- a/src/client/qwaylandbuffer_p.h +++ b/src/client/qwaylandbuffer_p.h @@ -51,7 +51,7 @@ // We mean it. // -#include +#include #include #include diff --git a/src/client/qwaylandclientexport.h b/src/client/qwaylandclientexport.h deleted file mode 100644 index f49f1aee..00000000 --- a/src/client/qwaylandclientexport.h +++ /dev/null @@ -1,69 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QWAYLANDCLIENTEXPORT_H -#define QWAYLANDCLIENTEXPORT_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include - -QT_BEGIN_NAMESPACE - -#if !defined(Q_WAYLAND_CLIENT_EXPORT) -# if defined(QT_SHARED) -# define Q_WAYLAND_CLIENT_EXPORT Q_DECL_EXPORT -# else -# define Q_WAYLAND_CLIENT_EXPORT -# endif -#endif - -QT_END_NAMESPACE - -#endif //QWAYLANDCLIENTEXPORT_H - diff --git a/src/client/qwaylandclipboard_p.h b/src/client/qwaylandclipboard_p.h index 64686134..d662e512 100644 --- a/src/client/qwaylandclipboard_p.h +++ b/src/client/qwaylandclipboard_p.h @@ -55,7 +55,7 @@ #include #include -#include +#include #ifndef QT_NO_DRAGANDDROP QT_BEGIN_NAMESPACE diff --git a/src/client/qwaylandcursor_p.h b/src/client/qwaylandcursor_p.h index 11333d34..a7d188f5 100644 --- a/src/client/qwaylandcursor_p.h +++ b/src/client/qwaylandcursor_p.h @@ -53,7 +53,7 @@ #include #include -#include +#include struct wl_cursor; struct wl_cursor_image; diff --git a/src/client/qwaylanddatadevicemanager_p.h b/src/client/qwaylanddatadevicemanager_p.h index 90ca301b..df8a67ab 100644 --- a/src/client/qwaylanddatadevicemanager_p.h +++ b/src/client/qwaylanddatadevicemanager_p.h @@ -51,7 +51,7 @@ // We mean it. // -#include +#include #include #ifndef QT_NO_DRAGANDDROP diff --git a/src/client/qwaylanddataoffer_p.h b/src/client/qwaylanddataoffer_p.h index 6368bff9..07adf342 100644 --- a/src/client/qwaylanddataoffer_p.h +++ b/src/client/qwaylanddataoffer_p.h @@ -53,7 +53,7 @@ #include -#include +#include #include #ifndef QT_NO_DRAGANDDROP diff --git a/src/client/qwaylanddatasource_p.h b/src/client/qwaylanddatasource_p.h index 9e29ae8b..fd860132 100644 --- a/src/client/qwaylanddatasource_p.h +++ b/src/client/qwaylanddatasource_p.h @@ -54,7 +54,7 @@ #include #include -#include +#include #ifndef QT_NO_DRAGANDDROP diff --git a/src/client/qwaylanddecorationfactory_p.h b/src/client/qwaylanddecorationfactory_p.h index 9d4e7a9f..606d9b89 100644 --- a/src/client/qwaylanddecorationfactory_p.h +++ b/src/client/qwaylanddecorationfactory_p.h @@ -51,7 +51,7 @@ // We mean it. // -#include +#include #include QT_BEGIN_NAMESPACE diff --git a/src/client/qwaylanddecorationplugin_p.h b/src/client/qwaylanddecorationplugin_p.h index dd33f341..c549b24b 100644 --- a/src/client/qwaylanddecorationplugin_p.h +++ b/src/client/qwaylanddecorationplugin_p.h @@ -51,7 +51,7 @@ // We mean it. // -#include +#include #include #include diff --git a/src/client/qwaylanddisplay_p.h b/src/client/qwaylanddisplay_p.h index fae17d53..afbe6765 100644 --- a/src/client/qwaylanddisplay_p.h +++ b/src/client/qwaylanddisplay_p.h @@ -61,7 +61,7 @@ #include #include -#include +#include #include #include diff --git a/src/client/qwaylanddnd_p.h b/src/client/qwaylanddnd_p.h index 464b9837..bcae8ace 100644 --- a/src/client/qwaylanddnd_p.h +++ b/src/client/qwaylanddnd_p.h @@ -57,7 +57,7 @@ #include #include -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/client/qwaylandextendedsurface_p.h b/src/client/qwaylandextendedsurface_p.h index 39b85438..39dc4fcf 100644 --- a/src/client/qwaylandextendedsurface_p.h +++ b/src/client/qwaylandextendedsurface_p.h @@ -54,7 +54,7 @@ #include #include -#include +#include #include #include diff --git a/src/client/qwaylandinputdevice.cpp b/src/client/qwaylandinputdevice.cpp index de052089..71be6bdf 100644 --- a/src/client/qwaylandinputdevice.cpp +++ b/src/client/qwaylandinputdevice.cpp @@ -73,7 +73,7 @@ namespace QtWaylandClient { QWaylandInputDevice::Keyboard::Keyboard(QWaylandInputDevice *p) : mParent(p) , mFocus(0) -#ifndef QT_NO_WAYLAND_XKB +#if QT_CONFIG(xkbcommon_evdev) , mXkbContext(0) , mXkbMap(0) , mXkbState(0) @@ -83,7 +83,7 @@ QWaylandInputDevice::Keyboard::Keyboard(QWaylandInputDevice *p) connect(&mRepeatTimer, SIGNAL(timeout()), this, SLOT(repeatKey())); } -#ifndef QT_NO_WAYLAND_XKB +#if QT_CONFIG(xkbcommon_evdev) bool QWaylandInputDevice::Keyboard::createDefaultKeyMap() { if (mXkbContext && mXkbMap && mXkbState) { @@ -125,7 +125,7 @@ void QWaylandInputDevice::Keyboard::releaseKeyMap() QWaylandInputDevice::Keyboard::~Keyboard() { -#ifndef QT_NO_WAYLAND_XKB +#if QT_CONFIG(xkbcommon_evdev) releaseKeyMap(); #endif if (mFocus) @@ -334,7 +334,7 @@ Qt::KeyboardModifiers QWaylandInputDevice::Keyboard::modifiers() const { Qt::KeyboardModifiers ret = Qt::NoModifier; -#ifndef QT_NO_WAYLAND_XKB +#if QT_CONFIG(xkbcommon_evdev) if (!mXkbState) return ret; @@ -602,7 +602,7 @@ void QWaylandInputDevice::Pointer::pointer_axis(uint32_t time, uint32_t axis, in void QWaylandInputDevice::Keyboard::keyboard_keymap(uint32_t format, int32_t fd, uint32_t size) { -#ifndef QT_NO_WAYLAND_XKB +#if QT_CONFIG(xkbcommon_evdev) if (format != WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1) { close(fd); return; @@ -702,7 +702,7 @@ void QWaylandInputDevice::Keyboard::keyboard_key(uint32_t serial, uint32_t time, if (isDown) mParent->mQDisplay->setLastInputDevice(mParent, serial, window); -#ifndef QT_NO_WAYLAND_XKB +#if QT_CONFIG(xkbcommon_evdev) if (!createDefaultKeyMap()) { return; } @@ -720,7 +720,7 @@ void QWaylandInputDevice::Keyboard::keyboard_key(uint32_t serial, uint32_t time, #endif if (state == WL_KEYBOARD_KEY_STATE_PRESSED -#ifndef QT_NO_WAYLAND_XKB +#if QT_CONFIG(xkbcommon_evdev) && xkb_keymap_key_repeats(mXkbMap, code) #endif ) { @@ -728,7 +728,7 @@ void QWaylandInputDevice::Keyboard::keyboard_key(uint32_t serial, uint32_t time, mRepeatCode = code; mRepeatTime = time; mRepeatText = text; -#ifndef QT_NO_WAYLAND_XKB +#if QT_CONFIG(xkbcommon_evdev) mRepeatSym = sym; #endif mRepeatTimer.setInterval(400); @@ -742,7 +742,7 @@ void QWaylandInputDevice::Keyboard::repeatKey() { mRepeatTimer.setInterval(25); sendKey(mFocus->window(), mRepeatTime, QEvent::KeyRelease, mRepeatKey, modifiers(), mRepeatCode, -#ifndef QT_NO_WAYLAND_XKB +#if QT_CONFIG(xkbcommon_evdev) mRepeatSym, mNativeModifiers, #else 0, 0, @@ -750,7 +750,7 @@ void QWaylandInputDevice::Keyboard::repeatKey() mRepeatText, true); sendKey(mFocus->window(), mRepeatTime, QEvent::KeyPress, mRepeatKey, modifiers(), mRepeatCode, -#ifndef QT_NO_WAYLAND_XKB +#if QT_CONFIG(xkbcommon_evdev) mRepeatSym, mNativeModifiers, #else 0, 0, @@ -765,7 +765,7 @@ void QWaylandInputDevice::Keyboard::keyboard_modifiers(uint32_t serial, uint32_t group) { Q_UNUSED(serial); -#ifndef QT_NO_WAYLAND_XKB +#if QT_CONFIG(xkbcommon_evdev) if (mXkbState) xkb_state_update_mask(mXkbState, mods_depressed, mods_latched, mods_locked, diff --git a/src/client/qwaylandinputdevice_p.h b/src/client/qwaylandinputdevice_p.h index d41bde56..6d458e35 100644 --- a/src/client/qwaylandinputdevice_p.h +++ b/src/client/qwaylandinputdevice_p.h @@ -51,6 +51,7 @@ // We mean it. // +#include #include #include @@ -64,7 +65,7 @@ #include -#ifndef QT_NO_WAYLAND_XKB +#if QT_CONFIG(xkbcommon_evdev) #include #include #endif @@ -194,7 +195,7 @@ public: QWaylandInputDevice *mParent; QWaylandWindow *mFocus; -#ifndef QT_NO_WAYLAND_XKB +#if QT_CONFIG(xkbcommon_evdev) xkb_context *mXkbContext; xkb_keymap *mXkbMap; xkb_state *mXkbState; @@ -205,7 +206,7 @@ public: uint32_t mRepeatCode; uint32_t mRepeatTime; QString mRepeatText; -#ifndef QT_NO_WAYLAND_XKB +#if QT_CONFIG(xkbcommon_evdev) xkb_keysym_t mRepeatSym; #endif QTimer mRepeatTimer; @@ -216,7 +217,7 @@ private slots: void repeatKey(); private: -#ifndef QT_NO_WAYLAND_XKB +#if QT_CONFIG(xkbcommon_evdev) bool createDefaultKeyMap(); void releaseKeyMap(); #endif diff --git a/src/client/qwaylandintegration_p.h b/src/client/qwaylandintegration_p.h index 3b91313b..e30a10ea 100644 --- a/src/client/qwaylandintegration_p.h +++ b/src/client/qwaylandintegration_p.h @@ -51,9 +51,8 @@ // We mean it. // +#include #include - -#include #include QT_BEGIN_NAMESPACE diff --git a/src/client/qwaylandnativeinterface.cpp b/src/client/qwaylandnativeinterface.cpp index 52c61eec..c0b675f7 100644 --- a/src/client/qwaylandnativeinterface.cpp +++ b/src/client/qwaylandnativeinterface.cpp @@ -119,7 +119,7 @@ void *QWaylandNativeInterface::nativeResourceForScreen(const QByteArray &resourc #ifndef QT_NO_OPENGL void *QWaylandNativeInterface::nativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) { -#ifdef QT_WAYLAND_GL_SUPPORT +#if QT_CONFIG(opengl) QByteArray lowerCaseResource = resource.toLower(); if (lowerCaseResource == "eglconfig" && m_integration->clientBufferIntegration()) diff --git a/src/client/qwaylandnativeinterface_p.h b/src/client/qwaylandnativeinterface_p.h index 49e52cdc..63a543ee 100644 --- a/src/client/qwaylandnativeinterface_p.h +++ b/src/client/qwaylandnativeinterface_p.h @@ -54,7 +54,7 @@ #include #include -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/client/qwaylandqtkey_p.h b/src/client/qwaylandqtkey_p.h index b749bd5f..155b6254 100644 --- a/src/client/qwaylandqtkey_p.h +++ b/src/client/qwaylandqtkey_p.h @@ -53,7 +53,7 @@ #include -#include +#include #include QT_BEGIN_NAMESPACE diff --git a/src/client/qwaylandscreen_p.h b/src/client/qwaylandscreen_p.h index 64980280..9c1f4673 100644 --- a/src/client/qwaylandscreen_p.h +++ b/src/client/qwaylandscreen_p.h @@ -52,7 +52,7 @@ // #include -#include +#include #include diff --git a/src/client/qwaylandshellsurface_p.h b/src/client/qwaylandshellsurface_p.h index b51c252f..e700d5a1 100644 --- a/src/client/qwaylandshellsurface_p.h +++ b/src/client/qwaylandshellsurface_p.h @@ -57,7 +57,7 @@ #include #include -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/client/qwaylandshm_p.h b/src/client/qwaylandshm_p.h index aafe4463..519482d0 100644 --- a/src/client/qwaylandshm_p.h +++ b/src/client/qwaylandshm_p.h @@ -54,7 +54,7 @@ #include #include -#include +#include #include QT_BEGIN_NAMESPACE diff --git a/src/client/qwaylandsubsurface_p.h b/src/client/qwaylandsubsurface_p.h index 0abd168b..00fb8d8e 100644 --- a/src/client/qwaylandsubsurface_p.h +++ b/src/client/qwaylandsubsurface_p.h @@ -56,7 +56,7 @@ #include #include -#include +#include #include QT_BEGIN_NAMESPACE diff --git a/src/client/qwaylandtouch_p.h b/src/client/qwaylandtouch_p.h index dc32b84a..b17bce6a 100644 --- a/src/client/qwaylandtouch_p.h +++ b/src/client/qwaylandtouch_p.h @@ -54,7 +54,7 @@ #include #include -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/client/qwaylandwindow_p.h b/src/client/qwaylandwindow_p.h index f5988fbd..ce295a0d 100644 --- a/src/client/qwaylandwindow_p.h +++ b/src/client/qwaylandwindow_p.h @@ -60,7 +60,7 @@ #include #include -#include +#include struct wl_egl_window; diff --git a/src/client/qwaylandwindowmanagerintegration_p.h b/src/client/qwaylandwindowmanagerintegration_p.h index 09a79d48..463b67ef 100644 --- a/src/client/qwaylandwindowmanagerintegration_p.h +++ b/src/client/qwaylandwindowmanagerintegration_p.h @@ -58,7 +58,7 @@ #include #include -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/client/qwaylandwlshellsurface_p.h b/src/client/qwaylandwlshellsurface_p.h index af86276b..89bce558 100644 --- a/src/client/qwaylandwlshellsurface_p.h +++ b/src/client/qwaylandwlshellsurface_p.h @@ -55,7 +55,7 @@ #include -#include +#include #include #include diff --git a/src/client/qwaylandxdgpopup_p.h b/src/client/qwaylandxdgpopup_p.h index 04416dbb..e10e5e62 100644 --- a/src/client/qwaylandxdgpopup_p.h +++ b/src/client/qwaylandxdgpopup_p.h @@ -47,7 +47,7 @@ #include -#include +#include #include #include diff --git a/src/client/qwaylandxdgshell_p.h b/src/client/qwaylandxdgshell_p.h index 8b35e36a..97a15e46 100644 --- a/src/client/qwaylandxdgshell_p.h +++ b/src/client/qwaylandxdgshell_p.h @@ -57,7 +57,7 @@ #include #include -#include +#include #include QT_BEGIN_NAMESPACE diff --git a/src/client/qwaylandxdgsurface_p.h b/src/client/qwaylandxdgsurface_p.h index 265d3ba8..184ef13e 100644 --- a/src/client/qwaylandxdgsurface_p.h +++ b/src/client/qwaylandxdgsurface_p.h @@ -56,7 +56,7 @@ #include -#include +#include #include #include diff --git a/src/client/shellintegration/qwaylandshellintegration_p.h b/src/client/shellintegration/qwaylandshellintegration_p.h index 144e5835..ab9b736b 100644 --- a/src/client/shellintegration/qwaylandshellintegration_p.h +++ b/src/client/shellintegration/qwaylandshellintegration_p.h @@ -51,8 +51,7 @@ // We mean it. // -#include -#include +#include #include QT_BEGIN_NAMESPACE diff --git a/src/client/shellintegration/qwaylandshellintegrationfactory_p.h b/src/client/shellintegration/qwaylandshellintegrationfactory_p.h index 0783465a..3edb0a89 100644 --- a/src/client/shellintegration/qwaylandshellintegrationfactory_p.h +++ b/src/client/shellintegration/qwaylandshellintegrationfactory_p.h @@ -51,7 +51,7 @@ // We mean it. // -#include +#include #include QT_BEGIN_NAMESPACE diff --git a/src/client/shellintegration/qwaylandshellintegrationplugin_p.h b/src/client/shellintegration/qwaylandshellintegrationplugin_p.h index be511bfc..266e6980 100644 --- a/src/client/shellintegration/qwaylandshellintegrationplugin_p.h +++ b/src/client/shellintegration/qwaylandshellintegrationplugin_p.h @@ -51,7 +51,7 @@ // We mean it. // -#include +#include #include #include diff --git a/src/compositor/compositor.pro b/src/compositor/compositor.pro index 935fc252..dc9000d9 100644 --- a/src/compositor/compositor.pro +++ b/src/compositor/compositor.pro @@ -5,8 +5,6 @@ QT = core gui-private qtHaveModule(quick): QT += quick -qtConfig(opengl):MODULE_DEFINES = QT_WAYLAND_COMPOSITOR_GL - CONFIG -= precompile_header CONFIG += link_pkgconfig diff --git a/src/compositor/compositor_api/qwaylandbufferref.cpp b/src/compositor/compositor_api/qwaylandbufferref.cpp index 6f175de9..9a40fe77 100644 --- a/src/compositor/compositor_api/qwaylandbufferref.cpp +++ b/src/compositor/compositor_api/qwaylandbufferref.cpp @@ -259,7 +259,7 @@ QImage QWaylandBufferRef::image() const return d->buffer->image(); } -#ifdef QT_WAYLAND_COMPOSITOR_GL +#if QT_CONFIG(opengl) /*! * Returns an OpenGL texture for the buffer. \a plane is the index for multi-plane formats, such as YUV. * diff --git a/src/compositor/compositor_api/qwaylandbufferref.h b/src/compositor/compositor_api/qwaylandbufferref.h index 06486ef3..7dd3a820 100644 --- a/src/compositor/compositor_api/qwaylandbufferref.h +++ b/src/compositor/compositor_api/qwaylandbufferref.h @@ -37,14 +37,15 @@ #ifndef QWAYLANDBUFFERREF_H #define QWAYLANDBUFFERREF_H +#include #include -#ifdef QT_WAYLAND_COMPOSITOR_GL +#if QT_CONFIG(opengl) #include #endif #include -#include +#include struct wl_resource; @@ -99,7 +100,7 @@ public: bool isSharedMemory() const; QImage image() const; -#ifdef QT_WAYLAND_COMPOSITOR_GL +#if QT_CONFIG(opengl) QOpenGLTexture *toOpenGLTexture(int plane = 0) const; #endif diff --git a/src/compositor/compositor_api/qwaylandclient.h b/src/compositor/compositor_api/qwaylandclient.h index 50e7baf7..ac651b2b 100644 --- a/src/compositor/compositor_api/qwaylandclient.h +++ b/src/compositor/compositor_api/qwaylandclient.h @@ -37,7 +37,7 @@ #ifndef QWAYLANDCLIENT_H #define QWAYLANDCLIENT_H -#include +#include #include diff --git a/src/compositor/compositor_api/qwaylandcompositor.cpp b/src/compositor/compositor_api/qwaylandcompositor.cpp index bcee61d8..29397f64 100644 --- a/src/compositor/compositor_api/qwaylandcompositor.cpp +++ b/src/compositor/compositor_api/qwaylandcompositor.cpp @@ -35,6 +35,7 @@ ** ****************************************************************************/ +#include "qtwaylandcompositorglobal_p.h" #include "qwaylandcompositor.h" #include "qwaylandcompositor_p.h" @@ -60,7 +61,7 @@ #include "hardware_integration/qwlserverbufferintegration_p.h" #include "hardware_integration/qwlserverbufferintegrationfactory_p.h" -#ifdef QT_WAYLAND_COMPOSITOR_GL +#if QT_CONFIG(opengl) #include "hardware_integration/qwlhwintegration_p.h" #endif @@ -80,7 +81,7 @@ #include #include -#ifdef QT_WAYLAND_COMPOSITOR_GL +#if QT_CONFIG(opengl) # include # include # include @@ -107,7 +108,7 @@ public: uint32_t code = ke->nativeScanCode; bool isDown = ke->keyType == QEvent::KeyPress; -#ifndef QT_NO_WAYLAND_XKB +#if QT_CONFIG(xkbcommon_evdev) QString text; Qt::KeyboardModifiers modifiers = QWaylandXkb::modifiers(keyb->xkbState()); @@ -143,7 +144,7 @@ public: QWaylandCompositorPrivate::QWaylandCompositorPrivate(QWaylandCompositor *compositor) : display(0) -#if defined (QT_WAYLAND_COMPOSITOR_GL) +#if QT_CONFIG(opengl) , use_hw_integration_extension(true) , client_buffer_integration(0) , server_buffer_integration(0) @@ -354,7 +355,7 @@ QWaylandSurface *QWaylandCompositorPrivate::createDefaultSurface() void QWaylandCompositorPrivate::initializeHardwareIntegration() { -#ifdef QT_WAYLAND_COMPOSITOR_GL +#if QT_CONFIG(opengl) Q_Q(QWaylandCompositor); if (use_hw_integration_extension) hw_integration.reset(new QtWayland::HardwareIntegration(q)); @@ -377,7 +378,7 @@ void QWaylandCompositorPrivate::initializeSeats() void QWaylandCompositorPrivate::loadClientBufferIntegration() { -#ifdef QT_WAYLAND_COMPOSITOR_GL +#if QT_CONFIG(opengl) Q_Q(QWaylandCompositor); QStringList keys = QtWayland::ClientBufferIntegrationFactory::keys(); QString targetKey; @@ -406,7 +407,7 @@ void QWaylandCompositorPrivate::loadClientBufferIntegration() void QWaylandCompositorPrivate::loadServerBufferIntegration() { -#ifdef QT_WAYLAND_COMPOSITOR_GL +#if QT_CONFIG(opengl) QStringList keys = QtWayland::ServerBufferIntegrationFactory::keys(); QString targetKey; QByteArray serverBufferIntegration = qgetenv("QT_WAYLAND_SERVER_BUFFER_INTEGRATION"); @@ -852,7 +853,7 @@ QWaylandSeat *QWaylandCompositor::seatFor(QInputEvent *inputEvent) */ bool QWaylandCompositor::useHardwareIntegrationExtension() const { -#ifdef QT_WAYLAND_COMPOSITOR_GL +#if QT_CONFIG(opengl) Q_D(const QWaylandCompositor); return d->use_hw_integration_extension; #else @@ -862,7 +863,7 @@ bool QWaylandCompositor::useHardwareIntegrationExtension() const void QWaylandCompositor::setUseHardwareIntegrationExtension(bool use) { -#ifdef QT_WAYLAND_COMPOSITOR_GL +#if QT_CONFIG(opengl) Q_D(QWaylandCompositor); if (use == d->use_hw_integration_extension) return; @@ -892,7 +893,7 @@ void QWaylandCompositor::grabSurface(QWaylandSurfaceGrabber *grabber, const QWay if (buffer.isSharedMemory()) { emit grabber->success(buffer.image()); } else { -#ifdef QT_WAYLAND_COMPOSITOR_GL +#if QT_CONFIG(opengl) if (QOpenGLContext::currentContext()) { QOpenGLFramebufferObject fbo(buffer.size()); fbo.bind(); diff --git a/src/compositor/compositor_api/qwaylandcompositor.h b/src/compositor/compositor_api/qwaylandcompositor.h index 8b190d1d..d0ec85f3 100644 --- a/src/compositor/compositor_api/qwaylandcompositor.h +++ b/src/compositor/compositor_api/qwaylandcompositor.h @@ -37,7 +37,7 @@ #ifndef QWAYLANDCOMPOSITOR_H #define QWAYLANDCOMPOSITOR_H -#include +#include #include #include diff --git a/src/compositor/compositor_api/qwaylandcompositor_p.h b/src/compositor/compositor_api/qwaylandcompositor_p.h index 5255f3d5..e59fdcbb 100644 --- a/src/compositor/compositor_api/qwaylandcompositor_p.h +++ b/src/compositor/compositor_api/qwaylandcompositor_p.h @@ -49,7 +49,7 @@ // We mean it. // -#include +#include #include #include #include @@ -139,7 +139,7 @@ protected: QList clients; -#ifdef QT_WAYLAND_COMPOSITOR_GL +#if QT_CONFIG(opengl) bool use_hw_integration_extension; QScopedPointer hw_integration; QScopedPointer client_buffer_integration; @@ -159,7 +159,7 @@ protected: QtWayland::ClientBufferIntegration * QWaylandCompositorPrivate::clientBufferIntegration() const { -#ifdef QT_WAYLAND_COMPOSITOR_GL +#if QT_CONFIG(opengl) return client_buffer_integration.data(); #else return 0; @@ -168,7 +168,7 @@ QtWayland::ClientBufferIntegration * QWaylandCompositorPrivate::clientBufferInte QtWayland::ServerBufferIntegration * QWaylandCompositorPrivate::serverBufferIntegration() const { -#ifdef QT_WAYLAND_COMPOSITOR_GL +#if QT_CONFIG(opengl) return server_buffer_integration.data(); #else return 0; diff --git a/src/compositor/compositor_api/qwaylanddestroylistener.h b/src/compositor/compositor_api/qwaylanddestroylistener.h index 580a5c46..81bbb7bc 100644 --- a/src/compositor/compositor_api/qwaylanddestroylistener.h +++ b/src/compositor/compositor_api/qwaylanddestroylistener.h @@ -39,7 +39,7 @@ #define QWAYLANDDESTROYLISTENER_H #include -#include +#include struct wl_resource; diff --git a/src/compositor/compositor_api/qwaylanddrag.h b/src/compositor/compositor_api/qwaylanddrag.h index 08ad1101..df192474 100644 --- a/src/compositor/compositor_api/qwaylanddrag.h +++ b/src/compositor/compositor_api/qwaylanddrag.h @@ -37,7 +37,7 @@ #ifndef QWAYLANDDRAG_H #define QWAYLANDDRAG_H -#include +#include #include #include diff --git a/src/compositor/compositor_api/qwaylandinputmethodcontrol_p.h b/src/compositor/compositor_api/qwaylandinputmethodcontrol_p.h index a4f9ce87..4517f5ee 100644 --- a/src/compositor/compositor_api/qwaylandinputmethodcontrol_p.h +++ b/src/compositor/compositor_api/qwaylandinputmethodcontrol_p.h @@ -48,7 +48,7 @@ // We mean it. // -#include +#include #include #include diff --git a/src/compositor/compositor_api/qwaylandkeyboard.cpp b/src/compositor/compositor_api/qwaylandkeyboard.cpp index 5bbec0a4..55381b45 100644 --- a/src/compositor/compositor_api/qwaylandkeyboard.cpp +++ b/src/compositor/compositor_api/qwaylandkeyboard.cpp @@ -35,6 +35,7 @@ ** ****************************************************************************/ +#include "qtwaylandcompositorglobal_p.h" #include "qwaylandkeyboard.h" #include "qwaylandkeyboard_p.h" #include @@ -47,7 +48,7 @@ #include #include -#ifndef QT_NO_WAYLAND_XKB +#if QT_CONFIG(xkbcommon_evdev) #include #include #endif @@ -65,7 +66,7 @@ QWaylandKeyboardPrivate::QWaylandKeyboardPrivate(QWaylandSeat *seat) , modsLocked() , group() , pendingKeymap(false) -#ifndef QT_NO_WAYLAND_XKB +#if QT_CONFIG(xkbcommon_evdev) , keymap_fd(-1) , xkb_state(0) #endif @@ -76,7 +77,7 @@ QWaylandKeyboardPrivate::QWaylandKeyboardPrivate(QWaylandSeat *seat) QWaylandKeyboardPrivate::~QWaylandKeyboardPrivate() { -#ifndef QT_NO_WAYLAND_XKB +#if QT_CONFIG(xkbcommon_evdev) if (xkb_context) { if (keymap_area) munmap(keymap_area, keymap_size); @@ -146,7 +147,7 @@ void QWaylandKeyboardPrivate::keyboard_bind_resource(wl_keyboard::Resource *reso if (resource->version() >= WL_KEYBOARD_REPEAT_INFO_SINCE_VERSION) send_repeat_info(resource->handle, repeatRate, repeatDelay); -#ifndef QT_NO_WAYLAND_XKB +#if QT_CONFIG(xkbcommon_evdev) if (xkb_context) { send_keymap(resource->handle, WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1, keymap_fd, keymap_size); @@ -201,7 +202,7 @@ void QWaylandKeyboardPrivate::modifiers(uint32_t serial, uint32_t mods_depressed void QWaylandKeyboardPrivate::updateModifierState(uint code, uint32_t state) { -#ifndef QT_NO_WAYLAND_XKB +#if QT_CONFIG(xkbcommon_evdev) if (!xkb_context) return; @@ -241,7 +242,7 @@ void QWaylandKeyboardPrivate::maybeUpdateKeymap() return; pendingKeymap = false; -#ifndef QT_NO_WAYLAND_XKB +#if QT_CONFIG(xkbcommon_evdev) if (!xkb_context) return; @@ -261,7 +262,7 @@ void QWaylandKeyboardPrivate::maybeUpdateKeymap() #endif } -#ifndef QT_NO_WAYLAND_XKB +#if QT_CONFIG(xkbcommon_evdev) static int createAnonymousFile(size_t size) { QString path = QStandardPaths::writableLocation(QStandardPaths::RuntimeLocation); @@ -404,7 +405,7 @@ QWaylandKeyboard::QWaylandKeyboard(QWaylandSeat *seat, QObject *parent) connect(keymap, &QWaylandKeymap::optionsChanged, this, &QWaylandKeyboard::updateKeymap); connect(keymap, &QWaylandKeymap::rulesChanged, this, &QWaylandKeyboard::updateKeymap); connect(keymap, &QWaylandKeymap::modelChanged, this, &QWaylandKeyboard::updateKeymap); -#ifndef QT_NO_WAYLAND_XKB +#if QT_CONFIG(xkbcommon_evdev) d->initXKB(); #endif } diff --git a/src/compositor/compositor_api/qwaylandkeyboard_p.h b/src/compositor/compositor_api/qwaylandkeyboard_p.h index fc43853c..b65dab44 100644 --- a/src/compositor/compositor_api/qwaylandkeyboard_p.h +++ b/src/compositor/compositor_api/qwaylandkeyboard_p.h @@ -49,7 +49,7 @@ // We mean it. // -#include +#include #include #include #include @@ -59,7 +59,7 @@ #include -#ifndef QT_NO_WAYLAND_XKB +#if QT_CONFIG(xkbcommon_evdev) #include #endif @@ -83,7 +83,7 @@ public: void modifiers(uint32_t serial, uint32_t mods_depressed, uint32_t mods_latched, uint32_t mods_locked, uint32_t group); -#ifndef QT_NO_WAYLAND_XKB +#if QT_CONFIG(xkbcommon_evdev) struct xkb_state *xkbState() const { return xkb_state; } uint32_t xkbModsMask() const { return modsDepressed | modsLatched | modsLocked; } #endif @@ -102,7 +102,7 @@ protected: void keyboard_release(Resource *resource) Q_DECL_OVERRIDE; private: -#ifndef QT_NO_WAYLAND_XKB +#if QT_CONFIG(xkbcommon_evdev) void initXKB(); void createXKBKeymap(); void createXKBState(xkb_keymap *keymap); @@ -124,7 +124,7 @@ private: uint32_t group; bool pendingKeymap; -#ifndef QT_NO_WAYLAND_XKB +#if QT_CONFIG(xkbcommon_evdev) size_t keymap_size; int keymap_fd; char *keymap_area; diff --git a/src/compositor/compositor_api/qwaylandkeymap.h b/src/compositor/compositor_api/qwaylandkeymap.h index c543691d..b72807a9 100644 --- a/src/compositor/compositor_api/qwaylandkeymap.h +++ b/src/compositor/compositor_api/qwaylandkeymap.h @@ -38,7 +38,7 @@ #define QWAYLANDKEYMAP_H #include -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/compositor/compositor_api/qwaylandoutput_p.h b/src/compositor/compositor_api/qwaylandoutput_p.h index 638575db..dffde7f9 100644 --- a/src/compositor/compositor_api/qwaylandoutput_p.h +++ b/src/compositor/compositor_api/qwaylandoutput_p.h @@ -50,7 +50,7 @@ // We mean it. // -#include +#include #include #include #include diff --git a/src/compositor/compositor_api/qwaylandoutputmode.h b/src/compositor/compositor_api/qwaylandoutputmode.h index aa44be92..0bcdaa6c 100644 --- a/src/compositor/compositor_api/qwaylandoutputmode.h +++ b/src/compositor/compositor_api/qwaylandoutputmode.h @@ -37,7 +37,7 @@ #ifndef QWAYLANDOUTPUTMODE_H #define QWAYLANDOUTPUTMODE_H -#include +#include #include QT_BEGIN_NAMESPACE diff --git a/src/compositor/compositor_api/qwaylandpointer_p.h b/src/compositor/compositor_api/qwaylandpointer_p.h index 54ac72d1..c02f831b 100644 --- a/src/compositor/compositor_api/qwaylandpointer_p.h +++ b/src/compositor/compositor_api/qwaylandpointer_p.h @@ -49,7 +49,7 @@ // We mean it. // -#include +#include #include #include diff --git a/src/compositor/compositor_api/qwaylandquickitem.h b/src/compositor/compositor_api/qwaylandquickitem.h index 821826d6..524813c4 100644 --- a/src/compositor/compositor_api/qwaylandquickitem.h +++ b/src/compositor/compositor_api/qwaylandquickitem.h @@ -37,7 +37,7 @@ #ifndef QWAYLANDSURFACEITEM_H #define QWAYLANDSURFACEITEM_H -#include +#include #include #include diff --git a/src/compositor/compositor_api/qwaylandresource.h b/src/compositor/compositor_api/qwaylandresource.h index bfb4b096..32a6d53f 100644 --- a/src/compositor/compositor_api/qwaylandresource.h +++ b/src/compositor/compositor_api/qwaylandresource.h @@ -38,7 +38,7 @@ #define QWAYLANDRESOURCE_H #include -#include +#include struct wl_resource; diff --git a/src/compositor/compositor_api/qwaylandseat.h b/src/compositor/compositor_api/qwaylandseat.h index 3e90342c..49c63260 100644 --- a/src/compositor/compositor_api/qwaylandseat.h +++ b/src/compositor/compositor_api/qwaylandseat.h @@ -41,7 +41,7 @@ #include #include -#include +#include #include #include diff --git a/src/compositor/compositor_api/qwaylandseat_p.h b/src/compositor/compositor_api/qwaylandseat_p.h index eb86aec3..1d687080 100644 --- a/src/compositor/compositor_api/qwaylandseat_p.h +++ b/src/compositor/compositor_api/qwaylandseat_p.h @@ -50,7 +50,7 @@ #include -#include +#include #include #include @@ -58,10 +58,6 @@ #include #include -#ifndef QT_NO_WAYLAND_XKB -#include -#endif - #include QT_BEGIN_NAMESPACE diff --git a/src/compositor/compositor_api/qwaylandsurface.h b/src/compositor/compositor_api/qwaylandsurface.h index 40753ad4..38043695 100644 --- a/src/compositor/compositor_api/qwaylandsurface.h +++ b/src/compositor/compositor_api/qwaylandsurface.h @@ -38,7 +38,7 @@ #ifndef QWAYLANDSURFACE_H #define QWAYLANDSURFACE_H -#include +#include #include #include diff --git a/src/compositor/compositor_api/qwaylandsurface_p.h b/src/compositor/compositor_api/qwaylandsurface_p.h index 94ec287b..23263107 100644 --- a/src/compositor/compositor_api/qwaylandsurface_p.h +++ b/src/compositor/compositor_api/qwaylandsurface_p.h @@ -49,7 +49,7 @@ // We mean it. // -#include +#include #include #include diff --git a/src/compositor/compositor_api/qwaylandsurfacegrabber.h b/src/compositor/compositor_api/qwaylandsurfacegrabber.h index 28f98410..512bd2ab 100644 --- a/src/compositor/compositor_api/qwaylandsurfacegrabber.h +++ b/src/compositor/compositor_api/qwaylandsurfacegrabber.h @@ -37,7 +37,7 @@ #ifndef QWAYLANDSURFACEGRABBER_H #define QWAYLANDSURFACEGRABBER_H -#include +#include #include QT_BEGIN_NAMESPACE diff --git a/src/compositor/compositor_api/qwaylandtouch_p.h b/src/compositor/compositor_api/qwaylandtouch_p.h index 75529134..9ee3e9c1 100644 --- a/src/compositor/compositor_api/qwaylandtouch_p.h +++ b/src/compositor/compositor_api/qwaylandtouch_p.h @@ -49,7 +49,7 @@ // We mean it. // -#include +#include #include #include #include diff --git a/src/compositor/compositor_api/qwaylandview.h b/src/compositor/compositor_api/qwaylandview.h index 98734003..e19f1ec4 100644 --- a/src/compositor/compositor_api/qwaylandview.h +++ b/src/compositor/compositor_api/qwaylandview.h @@ -38,7 +38,7 @@ #define QWAYLANDSURFACEVIEW_H #include -#include +#include #include #include diff --git a/src/compositor/extensions/qwaylandwlshell_p.h b/src/compositor/extensions/qwaylandwlshell_p.h index a087f6f7..77229ef0 100644 --- a/src/compositor/extensions/qwaylandwlshell_p.h +++ b/src/compositor/extensions/qwaylandwlshell_p.h @@ -37,7 +37,7 @@ #ifndef QWAYLANDWLSHELL_P_H #define QWAYLANDWLSHELL_P_H -#include +#include #include #include #include diff --git a/src/compositor/global/global.pri b/src/compositor/global/global.pri index e48b8a8c..29d4f437 100644 --- a/src/compositor/global/global.pri +++ b/src/compositor/global/global.pri @@ -1,7 +1,7 @@ INCLUDEPATH += global/ HEADERS += \ - global/qwaylandexport.h \ + global/qtwaylandcompositorglobal.h \ global/qwaylandcompositorextension.h \ global/qwaylandcompositorextension_p.h \ global/qwaylandquickextension.h \ diff --git a/src/compositor/global/qtwaylandcompositorglobal.h b/src/compositor/global/qtwaylandcompositorglobal.h new file mode 100644 index 00000000..403f1962 --- /dev/null +++ b/src/compositor/global/qtwaylandcompositorglobal.h @@ -0,0 +1,72 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QWAYLANDCOMPOSITORGLOBAL_H +#define QWAYLANDCOMPOSITORGLOBAL_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include +#include + +QT_BEGIN_NAMESPACE + +#if !defined(Q_WAYLAND_COMPOSITOR_EXPORT) +# if defined(QT_SHARED) && defined(QT_BUILD_COMPOSITOR_LIB) +# define Q_WAYLAND_COMPOSITOR_EXPORT Q_DECL_EXPORT +# elif defined(QT_SHARED) +# define Q_WAYLAND_COMPOSITOR_EXPORT Q_DECL_IMPORT +# else +# define Q_WAYLAND_COMPOSITOR_EXPORT +# endif +#endif + +QT_END_NAMESPACE + +#endif // QWAYLANDCOMPOSITORGLOBAL_H + diff --git a/src/compositor/global/qtwaylandcompositorglobal_p.h b/src/compositor/global/qtwaylandcompositorglobal_p.h new file mode 100644 index 00000000..629d5829 --- /dev/null +++ b/src/compositor/global/qtwaylandcompositorglobal_p.h @@ -0,0 +1,59 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QWAYLANDCOMPOSITORGLOBAL_P_H +#define QWAYLANDCOMPOSITORGLOBAL_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include +#include +#include + +#endif // QWAYLANDCOMPOSITORGLOBAL_P_H + diff --git a/src/compositor/global/qwaylandcompositorextension.h b/src/compositor/global/qwaylandcompositorextension.h index d666b4f2..e9aa8460 100644 --- a/src/compositor/global/qwaylandcompositorextension.h +++ b/src/compositor/global/qwaylandcompositorextension.h @@ -37,7 +37,7 @@ #ifndef QWAYLANDEXTENSION_H #define QWAYLANDEXTENSION_H -#include +#include #include #include diff --git a/src/compositor/global/qwaylandexport.h b/src/compositor/global/qwaylandexport.h deleted file mode 100644 index ddfa6aa7..00000000 --- a/src/compositor/global/qwaylandexport.h +++ /dev/null @@ -1,56 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the QtWaylandCompositor module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPLv3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef WAYLANDEXPORT_H -#define WAYLANDEXPORT_H - -#include - -QT_BEGIN_NAMESPACE - -#if !defined(Q_WAYLAND_COMPOSITOR_EXPORT) -# if defined(QT_SHARED) && defined(QT_BUILD_COMPOSITOR_LIB) -# define Q_WAYLAND_COMPOSITOR_EXPORT Q_DECL_EXPORT -# elif defined(QT_SHARED) -# define Q_WAYLAND_COMPOSITOR_EXPORT Q_DECL_IMPORT -# else -# define Q_WAYLAND_COMPOSITOR_EXPORT -# endif -#endif - -QT_END_NAMESPACE - -#endif //WAYLANDEXPORT_H diff --git a/src/compositor/hardware_integration/hardware_integration.pri b/src/compositor/hardware_integration/hardware_integration.pri index 624190a6..dd892e07 100644 --- a/src/compositor/hardware_integration/hardware_integration.pri +++ b/src/compositor/hardware_integration/hardware_integration.pri @@ -1,4 +1,4 @@ -contains(QT_CONFIG, opengl) { +qtConfig(opengl) { CONFIG += wayland-scanner WAYLANDSERVERSOURCES += \ ../extensions/server-buffer-extension.xml \ @@ -21,8 +21,6 @@ contains(QT_CONFIG, opengl) { hardware_integration/qwlserverbufferintegrationfactory.cpp \ hardware_integration/qwlserverbufferintegrationplugin.cpp \ hardware_integration/qwlhwintegration.cpp \ - - DEFINES += QT_WAYLAND_COMPOSITOR_GL } else { system(echo "Qt-Compositor configured as raster only compositor") } diff --git a/src/compositor/hardware_integration/qwlclientbufferintegration_p.h b/src/compositor/hardware_integration/qwlclientbufferintegration_p.h index a7de2c0e..c4bed100 100644 --- a/src/compositor/hardware_integration/qwlclientbufferintegration_p.h +++ b/src/compositor/hardware_integration/qwlclientbufferintegration_p.h @@ -48,7 +48,7 @@ // We mean it. // -#include +#include #include #include #include diff --git a/src/compositor/hardware_integration/qwlclientbufferintegrationfactory_p.h b/src/compositor/hardware_integration/qwlclientbufferintegrationfactory_p.h index 3c1d856c..1ed99083 100644 --- a/src/compositor/hardware_integration/qwlclientbufferintegrationfactory_p.h +++ b/src/compositor/hardware_integration/qwlclientbufferintegrationfactory_p.h @@ -48,7 +48,7 @@ // We mean it. // -#include +#include #include QT_BEGIN_NAMESPACE diff --git a/src/compositor/hardware_integration/qwlclientbufferintegrationplugin_p.h b/src/compositor/hardware_integration/qwlclientbufferintegrationplugin_p.h index d8bc33fb..e8fca43f 100644 --- a/src/compositor/hardware_integration/qwlclientbufferintegrationplugin_p.h +++ b/src/compositor/hardware_integration/qwlclientbufferintegrationplugin_p.h @@ -48,7 +48,7 @@ // We mean it. // -#include +#include #include #include diff --git a/src/compositor/hardware_integration/qwlserverbufferintegration_p.h b/src/compositor/hardware_integration/qwlserverbufferintegration_p.h index 3a71f18f..9a1287fa 100644 --- a/src/compositor/hardware_integration/qwlserverbufferintegration_p.h +++ b/src/compositor/hardware_integration/qwlserverbufferintegration_p.h @@ -52,7 +52,7 @@ #include #include -#include +#include struct wl_client; struct wl_resource; diff --git a/src/compositor/hardware_integration/qwlserverbufferintegrationfactory_p.h b/src/compositor/hardware_integration/qwlserverbufferintegrationfactory_p.h index b29ddd04..15d54a29 100644 --- a/src/compositor/hardware_integration/qwlserverbufferintegrationfactory_p.h +++ b/src/compositor/hardware_integration/qwlserverbufferintegrationfactory_p.h @@ -48,7 +48,7 @@ // We mean it. // -#include +#include #include QT_BEGIN_NAMESPACE diff --git a/src/compositor/hardware_integration/qwlserverbufferintegrationplugin_p.h b/src/compositor/hardware_integration/qwlserverbufferintegrationplugin_p.h index fc8c3bf1..6c144d74 100644 --- a/src/compositor/hardware_integration/qwlserverbufferintegrationplugin_p.h +++ b/src/compositor/hardware_integration/qwlserverbufferintegrationplugin_p.h @@ -48,7 +48,7 @@ // We mean it. // -#include +#include #include #include diff --git a/src/compositor/wayland_wrapper/qwlclientbuffer.cpp b/src/compositor/wayland_wrapper/qwlclientbuffer.cpp index 589ab825..d5295038 100644 --- a/src/compositor/wayland_wrapper/qwlclientbuffer.cpp +++ b/src/compositor/wayland_wrapper/qwlclientbuffer.cpp @@ -36,7 +36,7 @@ #include "qwlclientbuffer_p.h" -#ifdef QT_WAYLAND_COMPOSITOR_GL +#if QT_CONFIG(opengl) #include "hardware_integration/qwlclientbufferintegration_p.h" #include #include @@ -150,7 +150,7 @@ QImage SharedMemoryBuffer::image() const return QImage(); } -#ifdef QT_WAYLAND_COMPOSITOR_GL +#if QT_CONFIG(opengl) QOpenGLTexture *SharedMemoryBuffer::toOpenGlTexture(int plane) { Q_UNUSED(plane); diff --git a/src/compositor/wayland_wrapper/qwlclientbuffer_p.h b/src/compositor/wayland_wrapper/qwlclientbuffer_p.h index 78e07ee9..dafb3c5e 100644 --- a/src/compositor/wayland_wrapper/qwlclientbuffer_p.h +++ b/src/compositor/wayland_wrapper/qwlclientbuffer_p.h @@ -97,7 +97,7 @@ public: bool isSharedMemory() const { return wl_shm_buffer_get(m_buffer); } -#ifdef QT_WAYLAND_COMPOSITOR_GL +#if QT_CONFIG(opengl) virtual QOpenGLTexture *toOpenGlTexture(int plane = 0) = 0; #endif @@ -132,7 +132,7 @@ public: QWaylandSurface::Origin origin() const Q_DECL_OVERRIDE; QImage image() const; -#ifdef QT_WAYLAND_COMPOSITOR_GL +#if QT_CONFIG(opengl) QOpenGLTexture *toOpenGlTexture(int plane = 0) Q_DECL_OVERRIDE; private: diff --git a/src/compositor/wayland_wrapper/qwlregion_p.h b/src/compositor/wayland_wrapper/qwlregion_p.h index ca14c7a5..c63cdbc4 100644 --- a/src/compositor/wayland_wrapper/qwlregion_p.h +++ b/src/compositor/wayland_wrapper/qwlregion_p.h @@ -48,7 +48,7 @@ // We mean it. // -#include +#include #include diff --git a/src/compositor/wayland_wrapper/wayland_wrapper.pri b/src/compositor/wayland_wrapper/wayland_wrapper.pri index 38830340..48e55e51 100644 --- a/src/compositor/wayland_wrapper/wayland_wrapper.pri +++ b/src/compositor/wayland_wrapper/wayland_wrapper.pri @@ -24,8 +24,5 @@ SOURCES += \ INCLUDEPATH += wayland_wrapper -qtConfig(xkbcommon-evdev) { +qtConfig(xkbcommon-evdev): \ QMAKE_USE += xkbcommon_evdev -} else { - DEFINES += QT_NO_WAYLAND_XKB -} diff --git a/src/hardwareintegration/client/wayland-egl/wayland-egl.pri b/src/hardwareintegration/client/wayland-egl/wayland-egl.pri index f812144a..d7634b15 100644 --- a/src/hardwareintegration/client/wayland-egl/wayland-egl.pri +++ b/src/hardwareintegration/client/wayland-egl/wayland-egl.pri @@ -2,7 +2,6 @@ INCLUDEPATH += $$PWD QMAKE_USE += egl wayland-client wayland-egl -DEFINES += QT_EGL_WAYLAND QT += egl_support-private SOURCES += $$PWD/qwaylandeglclientbufferintegration.cpp \ diff --git a/src/hardwareintegration/compositor/brcm-egl/brcm-egl.pri b/src/hardwareintegration/compositor/brcm-egl/brcm-egl.pri index 2658e84b..e5f3d917 100644 --- a/src/hardwareintegration/compositor/brcm-egl/brcm-egl.pri +++ b/src/hardwareintegration/compositor/brcm-egl/brcm-egl.pri @@ -2,8 +2,6 @@ QT = waylandcompositor waylandcompositor-private core-private gui-private INCLUDEPATH += $$PWD -DEFINES += QT_NO_OPENGL_ES_3 - QMAKE_USE_PRIVATE += wayland-server for(p, QMAKE_LIBDIR_EGL) { diff --git a/src/imports/compositor/qwaylandmousetracker_p.h b/src/imports/compositor/qwaylandmousetracker_p.h index d90b037f..45c80208 100644 --- a/src/imports/compositor/qwaylandmousetracker_p.h +++ b/src/imports/compositor/qwaylandmousetracker_p.h @@ -39,7 +39,7 @@ #include -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/imports/compositor/qwaylandquickcompositorplugin.cpp b/src/imports/compositor/qwaylandquickcompositorplugin.cpp index 28c517fd..0caa4a35 100644 --- a/src/imports/compositor/qwaylandquickcompositorplugin.cpp +++ b/src/imports/compositor/qwaylandquickcompositorplugin.cpp @@ -59,7 +59,7 @@ #include #include -#include +#include #include "qwaylandmousetracker_p.h" QT_BEGIN_NAMESPACE diff --git a/src/plugins/shellintegration/ivi-shell/ivi-shell.pro b/src/plugins/shellintegration/ivi-shell/ivi-shell.pro index d254b9fc..baaf1698 100644 --- a/src/plugins/shellintegration/ivi-shell/ivi-shell.pro +++ b/src/plugins/shellintegration/ivi-shell/ivi-shell.pro @@ -6,11 +6,8 @@ CONFIG += wayland-scanner QMAKE_USE += wayland-client -qtConfig(xkbcommon-evdev) { +qtConfig(xkbcommon-evdev): \ QMAKE_USE += xkbcommon_evdev -} else { - DEFINES += QT_NO_WAYLAND_XKB -} WAYLANDCLIENTSOURCES += \ ../../../3rdparty/protocol/ivi-application.xml \ diff --git a/src/shared/qwaylandxkb.cpp b/src/shared/qwaylandxkb.cpp index 2afdcce8..3e04467d 100644 --- a/src/shared/qwaylandxkb.cpp +++ b/src/shared/qwaylandxkb.cpp @@ -43,8 +43,6 @@ #include #include -#ifndef QT_NO_WAYLAND_XKB - #include QT_BEGIN_NAMESPACE @@ -377,5 +375,3 @@ QVector QWaylandXkb::toKeysym(QKeyEvent *event) } QT_END_NAMESPACE - -#endif // QT_NO_WAYLAND_XKB diff --git a/src/shared/qwaylandxkb_p.h b/src/shared/qwaylandxkb_p.h index cdebf1b0..230159fb 100644 --- a/src/shared/qwaylandxkb_p.h +++ b/src/shared/qwaylandxkb_p.h @@ -41,8 +41,6 @@ #ifndef QWAYLANDXKB_H #define QWAYLANDXKB_H -#ifndef QT_NO_WAYLAND_XKB - #include #include #include @@ -65,6 +63,4 @@ public: QT_END_NAMESPACE -#endif // QT_NO_WAYLAND_XKB - #endif diff --git a/sync.profile b/sync.profile index 1276df08..458ee9f2 100644 --- a/sync.profile +++ b/sync.profile @@ -7,6 +7,12 @@ %classnames = ( ); %deprecatedheaders = ( + "QtWaylandClient" => { + "qwaylandclientexport.h" => "QtWaylandClient/qtwaylandclientglobal.h" + }, + "QtWaylandCompositor" => { + "qwaylandexport.h" => "QtWaylandCompositor/qtwaylandcompositorglobal.h" + } ); %classnames = ( "qwaylandquickextension.h" => "QWaylandQuickExtension", diff --git a/tests/auto/compositor/compositor/compositor.pro b/tests/auto/compositor/compositor/compositor.pro index c0b91963..f0cdaf32 100644 --- a/tests/auto/compositor/compositor/compositor.pro +++ b/tests/auto/compositor/compositor/compositor.pro @@ -7,11 +7,8 @@ QT += core-private gui-private waylandcompositor waylandcompositor-private QMAKE_USE += wayland-client wayland-server -qtConfig(xkbcommon-evdev) { +qtConfig(xkbcommon-evdev) QMAKE_USE += xkbcommon_evdev -} else { - DEFINES += QT_NO_WAYLAND_XKB -} WAYLANDCLIENTSOURCES += \ ../../../../src/3rdparty/protocol/xdg-shell.xml \ -- cgit v1.2.1 From 893fd8540f2a2182a5e28fc88d59310f0aff8afe Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Wed, 16 Nov 2016 11:10:14 +0100 Subject: Use new feature system, part 2 Convert all uses of QT_NO_FOO to proper QT_CONFIG(foo) checks. Change-Id: Id0f0b3325c246567a43d6b2d71b0d69e5535e648 Reviewed-by: Jan Arne Petersen Reviewed-by: Paul Olav Tvete Reviewed-by: Oswald Buddenhagen --- .../qwaylandclientbufferintegrationfactory.cpp | 6 +++--- .../qwaylandserverbufferintegrationfactory.cpp | 6 +++--- .../qwaylandinputdeviceintegrationfactory.cpp | 6 +++--- src/client/qwaylandclipboard.cpp | 4 ++-- src/client/qwaylandclipboard_p.h | 4 ++-- src/client/qwaylanddatadevice.cpp | 4 ++-- src/client/qwaylanddatadevice_p.h | 5 +++-- src/client/qwaylanddatadevicemanager.cpp | 4 ++-- src/client/qwaylanddatadevicemanager_p.h | 4 ++-- src/client/qwaylanddataoffer.cpp | 4 ++-- src/client/qwaylanddataoffer_p.h | 4 ++-- src/client/qwaylanddatasource.cpp | 4 ++-- src/client/qwaylanddatasource_p.h | 4 ++-- src/client/qwaylanddecorationfactory.cpp | 6 +++--- src/client/qwaylanddisplay.cpp | 6 +++--- src/client/qwaylanddisplay_p.h | 4 ++-- src/client/qwaylanddnd.cpp | 4 ++-- src/client/qwaylanddnd_p.h | 2 +- src/client/qwaylandinputdevice.cpp | 2 +- src/client/qwaylandintegration.cpp | 16 ++++++++-------- src/client/qwaylandintegration_p.h | 10 +++++----- src/client/qwaylandnativeinterface.cpp | 4 ++-- src/client/qwaylandnativeinterface_p.h | 2 +- src/client/qwaylandshmbackingstore.cpp | 4 ++-- src/client/qwaylandshmbackingstore_p.h | 2 +- src/client/qwaylandwindow.cpp | 2 +- .../shellintegration/qwaylandshellintegrationfactory.cpp | 6 +++--- .../compositor_api/qwaylandinputmethodcontrol.cpp | 4 ++-- .../compositor_api/qwaylandinputmethodcontrol.h | 5 +++-- src/compositor/compositor_api/qwaylandquickitem.cpp | 12 ++++++------ src/compositor/compositor_api/qwaylandquickitem.h | 6 +++--- .../qwlclientbufferintegrationfactory.cpp | 6 +++--- .../qwlserverbufferintegrationfactory.cpp | 6 +++--- src/plugins/decorations/bradient/main.cpp | 4 ++-- 34 files changed, 87 insertions(+), 85 deletions(-) diff --git a/src/client/hardwareintegration/qwaylandclientbufferintegrationfactory.cpp b/src/client/hardwareintegration/qwaylandclientbufferintegrationfactory.cpp index aa197e3d..4e7e7ee5 100644 --- a/src/client/hardwareintegration/qwaylandclientbufferintegrationfactory.cpp +++ b/src/client/hardwareintegration/qwaylandclientbufferintegrationfactory.cpp @@ -48,7 +48,7 @@ QT_BEGIN_NAMESPACE namespace QtWaylandClient { -#ifndef QT_NO_LIBRARY +#if QT_CONFIG(library) Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader, (QWaylandClientBufferIntegrationFactoryInterface_iid, QLatin1String("/wayland-graphics-integration-client"), Qt::CaseInsensitive)) Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, directLoader, @@ -57,7 +57,7 @@ Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, directLoader, QStringList QWaylandClientBufferIntegrationFactory::keys(const QString &pluginPath) { -#ifndef QT_NO_LIBRARY +#if QT_CONFIG(library) QStringList list; if (!pluginPath.isEmpty()) { QCoreApplication::addLibraryPath(pluginPath); @@ -80,7 +80,7 @@ QStringList QWaylandClientBufferIntegrationFactory::keys(const QString &pluginPa QWaylandClientBufferIntegration *QWaylandClientBufferIntegrationFactory::create(const QString &name, const QStringList &args, const QString &pluginPath) { -#ifndef QT_NO_LIBRARY +#if QT_CONFIG(library) // Try loading the plugin from platformPluginPath first: if (!pluginPath.isEmpty()) { QCoreApplication::addLibraryPath(pluginPath); diff --git a/src/client/hardwareintegration/qwaylandserverbufferintegrationfactory.cpp b/src/client/hardwareintegration/qwaylandserverbufferintegrationfactory.cpp index dfa0b465..527dc571 100644 --- a/src/client/hardwareintegration/qwaylandserverbufferintegrationfactory.cpp +++ b/src/client/hardwareintegration/qwaylandserverbufferintegrationfactory.cpp @@ -48,7 +48,7 @@ QT_BEGIN_NAMESPACE namespace QtWaylandClient { -#ifndef QT_NO_LIBRARY +#if QT_CONFIG(library) Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader, (QWaylandServerBufferIntegrationFactoryInterface_iid, QLatin1String("/wayland-graphics-integration-client"), Qt::CaseInsensitive)) Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, directLoader, @@ -57,7 +57,7 @@ Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, directLoader, QStringList QWaylandServerBufferIntegrationFactory::keys(const QString &pluginPath) { -#ifndef QT_NO_LIBRARY +#if QT_CONFIG(library) QStringList list; if (!pluginPath.isEmpty()) { QCoreApplication::addLibraryPath(pluginPath); @@ -80,7 +80,7 @@ QStringList QWaylandServerBufferIntegrationFactory::keys(const QString &pluginPa QWaylandServerBufferIntegration *QWaylandServerBufferIntegrationFactory::create(const QString &name, const QStringList &args, const QString &pluginPath) { -#ifndef QT_NO_LIBRARY +#if QT_CONFIG(library) // Try loading the plugin from platformPluginPath first: if (!pluginPath.isEmpty()) { QCoreApplication::addLibraryPath(pluginPath); diff --git a/src/client/inputdeviceintegration/qwaylandinputdeviceintegrationfactory.cpp b/src/client/inputdeviceintegration/qwaylandinputdeviceintegrationfactory.cpp index de303d00..c069a364 100644 --- a/src/client/inputdeviceintegration/qwaylandinputdeviceintegrationfactory.cpp +++ b/src/client/inputdeviceintegration/qwaylandinputdeviceintegrationfactory.cpp @@ -48,7 +48,7 @@ QT_BEGIN_NAMESPACE namespace QtWaylandClient { -#ifndef QT_NO_LIBRARY +#if QT_CONFIG(library) Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader, (QWaylandInputDeviceIntegrationFactoryInterface_iid, QLatin1String("/wayland-inputdevice-integration"), Qt::CaseInsensitive)) Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, directLoader, @@ -57,7 +57,7 @@ Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, directLoader, QStringList QWaylandInputDeviceIntegrationFactory::keys(const QString &pluginPath) { -#ifndef QT_NO_LIBRARY +#if QT_CONFIG(library) QStringList list; if (!pluginPath.isEmpty()) { QCoreApplication::addLibraryPath(pluginPath); @@ -80,7 +80,7 @@ QStringList QWaylandInputDeviceIntegrationFactory::keys(const QString &pluginPat QWaylandInputDeviceIntegration *QWaylandInputDeviceIntegrationFactory::create(const QString &name, const QStringList &args, const QString &pluginPath) { -#ifndef QT_NO_LIBRARY +#if QT_CONFIG(library) // Try loading the plugin from platformPluginPath first: if (!pluginPath.isEmpty()) { QCoreApplication::addLibraryPath(pluginPath); diff --git a/src/client/qwaylandclipboard.cpp b/src/client/qwaylandclipboard.cpp index 409abaa5..68fb737c 100644 --- a/src/client/qwaylandclipboard.cpp +++ b/src/client/qwaylandclipboard.cpp @@ -44,7 +44,7 @@ #include "qwaylanddatasource_p.h" #include "qwaylanddatadevice_p.h" -#ifndef QT_NO_DRAGANDDROP +#if QT_CONFIG(draganddrop) QT_BEGIN_NAMESPACE @@ -118,4 +118,4 @@ bool QWaylandClipboard::ownsMode(QClipboard::Mode mode) const QT_END_NAMESPACE -#endif // QT_NO_DRAGANDDROP +#endif // draganddrop diff --git a/src/client/qwaylandclipboard_p.h b/src/client/qwaylandclipboard_p.h index d662e512..584322e0 100644 --- a/src/client/qwaylandclipboard_p.h +++ b/src/client/qwaylandclipboard_p.h @@ -57,7 +57,7 @@ #include -#ifndef QT_NO_DRAGANDDROP +#if QT_CONFIG(draganddrop) QT_BEGIN_NAMESPACE namespace QtWaylandClient { @@ -85,6 +85,6 @@ private: QT_END_NAMESPACE -#endif // QT_NO_DRAGANDDROP +#endif // draganddrop #endif // QWAYLANDCLIPBOARD_H diff --git a/src/client/qwaylanddatadevice.cpp b/src/client/qwaylanddatadevice.cpp index f1a1ba6f..b76647ea 100644 --- a/src/client/qwaylanddatadevice.cpp +++ b/src/client/qwaylanddatadevice.cpp @@ -56,7 +56,7 @@ #include #include -#ifndef QT_NO_DRAGANDDROP +#if QT_CONFIG(draganddrop) QT_BEGIN_NAMESPACE @@ -271,4 +271,4 @@ QPoint QWaylandDataDevice::calculateDragPosition(int x, int y, QWindow *wnd) con QT_END_NAMESPACE -#endif // QT_NO_DRAGANDDROP +#endif // draganddrop diff --git a/src/client/qwaylanddatadevice_p.h b/src/client/qwaylanddatadevice_p.h index 318636de..0b16f97d 100644 --- a/src/client/qwaylanddatadevice_p.h +++ b/src/client/qwaylanddatadevice_p.h @@ -52,13 +52,14 @@ // We mean it. // +#include #include #include #include #include -#ifndef QT_NO_DRAGANDDROP +#if QT_CONFIG(draganddrop) QT_BEGIN_NAMESPACE @@ -122,6 +123,6 @@ private: QT_END_NAMESPACE -#endif // QT_NO_DRAGANDDROP +#endif // draganddrop #endif // QWAYLANDDATADEVICE_H diff --git a/src/client/qwaylanddatadevicemanager.cpp b/src/client/qwaylanddatadevicemanager.cpp index 5c6f7415..c398b86f 100644 --- a/src/client/qwaylanddatadevicemanager.cpp +++ b/src/client/qwaylanddatadevicemanager.cpp @@ -46,7 +46,7 @@ #include -#ifndef QT_NO_DRAGANDDROP +#if QT_CONFIG(draganddrop) QT_BEGIN_NAMESPACE @@ -83,4 +83,4 @@ QWaylandDisplay *QWaylandDataDeviceManager::display() const QT_END_NAMESPACE -#endif // QT_NO_DRAGANDDROP +#endif // draganddrop diff --git a/src/client/qwaylanddatadevicemanager_p.h b/src/client/qwaylanddatadevicemanager_p.h index df8a67ab..e7fc2113 100644 --- a/src/client/qwaylanddatadevicemanager_p.h +++ b/src/client/qwaylanddatadevicemanager_p.h @@ -54,7 +54,7 @@ #include #include -#ifndef QT_NO_DRAGANDDROP +#if QT_CONFIG(draganddrop) QT_BEGIN_NAMESPACE @@ -83,6 +83,6 @@ private: QT_END_NAMESPACE -#endif // QT_NO_DRAGANDDROP +#endif // draganddrop #endif // QWAYLANDDATADEVICEMANAGER_H diff --git a/src/client/qwaylanddataoffer.cpp b/src/client/qwaylanddataoffer.cpp index b33a98e0..56a18f00 100644 --- a/src/client/qwaylanddataoffer.cpp +++ b/src/client/qwaylanddataoffer.cpp @@ -47,7 +47,7 @@ #include -#ifndef QT_NO_DRAGANDDROP +#if QT_CONFIG(draganddrop) QT_BEGIN_NAMESPACE @@ -184,4 +184,4 @@ int QWaylandMimeData::readData(int fd, QByteArray &data) const QT_END_NAMESPACE -#endif // QT_NO_DRAGANDDROP +#endif // draganddrop diff --git a/src/client/qwaylanddataoffer_p.h b/src/client/qwaylanddataoffer_p.h index 07adf342..96799c86 100644 --- a/src/client/qwaylanddataoffer_p.h +++ b/src/client/qwaylanddataoffer_p.h @@ -56,7 +56,7 @@ #include #include -#ifndef QT_NO_DRAGANDDROP +#if QT_CONFIG(draganddrop) QT_BEGIN_NAMESPACE namespace QtWaylandClient { @@ -106,5 +106,5 @@ private: } QT_END_NAMESPACE -#endif // QT_NO_DRAGANDDROP +#endif // draganddrop #endif diff --git a/src/client/qwaylanddatasource.cpp b/src/client/qwaylanddatasource.cpp index bada694c..036bd0d8 100644 --- a/src/client/qwaylanddatasource.cpp +++ b/src/client/qwaylanddatasource.cpp @@ -49,7 +49,7 @@ #include -#ifndef QT_NO_DRAGANDDROP +#if QT_CONFIG(draganddrop) QT_BEGIN_NAMESPACE @@ -99,4 +99,4 @@ void QWaylandDataSource::data_source_target(const QString &mime_type) QT_END_NAMESPACE -#endif // QT_NO_DRAGANDDROP +#endif // draganddrop diff --git a/src/client/qwaylanddatasource_p.h b/src/client/qwaylanddatasource_p.h index fd860132..540e6ad7 100644 --- a/src/client/qwaylanddatasource_p.h +++ b/src/client/qwaylanddatasource_p.h @@ -56,7 +56,7 @@ #include #include -#ifndef QT_NO_DRAGANDDROP +#if QT_CONFIG(draganddrop) QT_BEGIN_NAMESPACE @@ -94,6 +94,6 @@ private: QT_END_NAMESPACE -#endif // QT_NO_DRAGANDDROP +#endif // draganddrop #endif // QWAYLANDDATASOURCE_H diff --git a/src/client/qwaylanddecorationfactory.cpp b/src/client/qwaylanddecorationfactory.cpp index 43c712fc..1279e303 100644 --- a/src/client/qwaylanddecorationfactory.cpp +++ b/src/client/qwaylanddecorationfactory.cpp @@ -48,7 +48,7 @@ QT_BEGIN_NAMESPACE namespace QtWaylandClient { -#ifndef QT_NO_LIBRARY +#if QT_CONFIG(library) Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader, (QWaylandDecorationFactoryInterface_iid, QLatin1String("/wayland-decoration-client"), Qt::CaseInsensitive)) Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, directLoader, @@ -57,7 +57,7 @@ Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, directLoader, QStringList QWaylandDecorationFactory::keys(const QString &pluginPath) { -#ifndef QT_NO_LIBRARY +#if QT_CONFIG(library) QStringList list; if (!pluginPath.isEmpty()) { QCoreApplication::addLibraryPath(pluginPath); @@ -80,7 +80,7 @@ QStringList QWaylandDecorationFactory::keys(const QString &pluginPath) QWaylandAbstractDecoration *QWaylandDecorationFactory::create(const QString &name, const QStringList &args, const QString &pluginPath) { -#ifndef QT_NO_LIBRARY +#if QT_CONFIG(library) // Try loading the plugin from platformPluginPath first: if (!pluginPath.isEmpty()) { QCoreApplication::addLibraryPath(pluginPath); diff --git a/src/client/qwaylanddisplay.cpp b/src/client/qwaylanddisplay.cpp index de38e3f2..534373b1 100644 --- a/src/client/qwaylanddisplay.cpp +++ b/src/client/qwaylanddisplay.cpp @@ -120,7 +120,7 @@ QWaylandWindowManagerIntegration *QWaylandDisplay::windowManagerIntegration() co QWaylandDisplay::QWaylandDisplay(QWaylandIntegration *waylandIntegration) : mWaylandIntegration(waylandIntegration) -#ifndef QT_NO_DRAGANDDROP +#if QT_CONFIG(draganddrop) , mDndSelectionHandler(0) #endif , mWindowExtension(0) @@ -160,7 +160,7 @@ QWaylandDisplay::~QWaylandDisplay(void) mWaylandIntegration->destroyScreen(screen); } mScreens.clear(); -#ifndef QT_NO_DRAGANDDROP +#if QT_CONFIG(draganddrop) delete mDndSelectionHandler.take(); #endif wl_display_disconnect(mDisplay); @@ -255,7 +255,7 @@ 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 +#if QT_CONFIG(draganddrop) } else if (interface == QStringLiteral("wl_data_device_manager")) { mDndSelectionHandler.reset(new QWaylandDataDeviceManager(this, id)); #endif diff --git a/src/client/qwaylanddisplay_p.h b/src/client/qwaylanddisplay_p.h index afbe6765..a4631b95 100644 --- a/src/client/qwaylanddisplay_p.h +++ b/src/client/qwaylanddisplay_p.h @@ -137,7 +137,7 @@ public: QList inputDevices() const { return mInputDevices; } QWaylandInputDevice *defaultInputDevice() const; QWaylandInputDevice *currentInputDevice() const { return defaultInputDevice(); } -#ifndef QT_NO_DRAGANDDROP +#if QT_CONFIG(draganddrop) QWaylandDataDeviceManager *dndSelectionHandler() const { return mDndSelectionHandler.data(); } #endif QtWayland::qt_surface_extension *windowExtension() const { return mWindowExtension.data(); } @@ -202,7 +202,7 @@ private: QList mInputDevices; QList mRegistryListeners; QWaylandIntegration *mWaylandIntegration; -#ifndef QT_NO_DRAGANDDROP +#if QT_CONFIG(draganddrop) QScopedPointer mDndSelectionHandler; #endif QScopedPointer mWindowExtension; diff --git a/src/client/qwaylanddnd.cpp b/src/client/qwaylanddnd.cpp index e29267fc..54c075c4 100644 --- a/src/client/qwaylanddnd.cpp +++ b/src/client/qwaylanddnd.cpp @@ -50,7 +50,7 @@ #include QT_BEGIN_NAMESPACE -#ifndef QT_NO_DRAGANDDROP +#if QT_CONFIG(draganddrop) namespace QtWaylandClient { QWaylandDrag::QWaylandDrag(QWaylandDisplay *display) @@ -131,5 +131,5 @@ void QWaylandDrag::finishDrag(const QPlatformDropQtResponse &response) } } -#endif // QT_NO_DRAGANDDROP +#endif // draganddrop QT_END_NAMESPACE diff --git a/src/client/qwaylanddnd_p.h b/src/client/qwaylanddnd_p.h index bcae8ace..215a8b74 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 +#if QT_CONFIG(draganddrop) class Q_WAYLAND_CLIENT_EXPORT QWaylandDrag : public QBasicDrag { public: diff --git a/src/client/qwaylandinputdevice.cpp b/src/client/qwaylandinputdevice.cpp index 71be6bdf..4e8ef7b6 100644 --- a/src/client/qwaylandinputdevice.cpp +++ b/src/client/qwaylandinputdevice.cpp @@ -190,7 +190,7 @@ QWaylandInputDevice::QWaylandInputDevice(QWaylandDisplay *display, int version, , mSerial(0) , mTouchDevice(0) { -#ifndef QT_NO_DRAGANDDROP +#if QT_CONFIG(draganddrop) if (mQDisplay->dndSelectionHandler()) { mDataDevice = mQDisplay->dndSelectionHandler()->getDataDevice(this); } diff --git a/src/client/qwaylandintegration.cpp b/src/client/qwaylandintegration.cpp index 32b4b895..748f4f29 100644 --- a/src/client/qwaylandintegration.cpp +++ b/src/client/qwaylandintegration.cpp @@ -96,7 +96,7 @@ public: const QByteArray desktopEnvironment = QGuiApplicationPrivate::platformIntegration()->services()->desktopEnvironment(); if (desktopEnvironment == QByteArrayLiteral("KDE")) { -#ifndef QT_NO_SETTINGS +#if QT_CONFIG(settings) result.push_back(QStringLiteral("kde")); #endif } else if (!desktopEnvironment.isEmpty() && @@ -122,7 +122,7 @@ QWaylandIntegration::QWaylandIntegration() , mInputDeviceIntegration(Q_NULLPTR) , mFontDb(new QGenericUnixFontDatabase()) , mNativeInterface(new QWaylandNativeInterface(this)) -#ifndef QT_NO_ACCESSIBILITY +#if QT_CONFIG(accessibility) , mAccessibility(new QPlatformAccessibility()) #endif , mClientBufferIntegrationInitialized(false) @@ -131,7 +131,7 @@ QWaylandIntegration::QWaylandIntegration() { initializeInputDeviceIntegration(); mDisplay.reset(new QWaylandDisplay(this)); -#ifndef QT_NO_DRAGANDDROP +#if QT_CONFIG(draganddrop) mClipboard.reset(new QWaylandClipboard(mDisplay.data())); mDrag.reset(new QWaylandDrag(mDisplay.data())); #endif @@ -188,14 +188,14 @@ QPlatformWindow *QWaylandIntegration::createPlatformWindow(QWindow *window) cons return new QWaylandShmWindow(window); } -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) QPlatformOpenGLContext *QWaylandIntegration::createPlatformOpenGLContext(QOpenGLContext *context) const { if (mDisplay->clientBufferIntegration()) return mDisplay->clientBufferIntegration()->createPlatformOpenGLContext(context->format(), context->shareHandle()); return 0; } -#endif // QT_NO_OPENGL +#endif // opengl QPlatformBackingStore *QWaylandIntegration::createPlatformBackingStore(QWindow *window) const { @@ -223,7 +223,7 @@ QPlatformFontDatabase *QWaylandIntegration::fontDatabase() const return mFontDb.data(); } -#ifndef QT_NO_DRAGANDDROP +#if QT_CONFIG(draganddrop) QPlatformClipboard *QWaylandIntegration::clipboard() const { return mClipboard.data(); @@ -233,7 +233,7 @@ QPlatformDrag *QWaylandIntegration::drag() const { return mDrag.data(); } -#endif // QT_NO_DRAGANDDROP +#endif // draganddrop QPlatformInputContext *QWaylandIntegration::inputContext() const { @@ -255,7 +255,7 @@ QVariant QWaylandIntegration::styleHint(StyleHint hint) const return QPlatformIntegration::styleHint(hint); } -#ifndef QT_NO_ACCESSIBILITY +#if QT_CONFIG(accessibility) QPlatformAccessibility *QWaylandIntegration::accessibility() const { return mAccessibility.data(); diff --git a/src/client/qwaylandintegration_p.h b/src/client/qwaylandintegration_p.h index e30a10ea..39bd812d 100644 --- a/src/client/qwaylandintegration_p.h +++ b/src/client/qwaylandintegration_p.h @@ -75,7 +75,7 @@ public: bool hasCapability(QPlatformIntegration::Capability cap) const Q_DECL_OVERRIDE; QPlatformWindow *createPlatformWindow(QWindow *window) const Q_DECL_OVERRIDE; -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const Q_DECL_OVERRIDE; #endif QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const Q_DECL_OVERRIDE; @@ -86,7 +86,7 @@ public: QPlatformFontDatabase *fontDatabase() const Q_DECL_OVERRIDE; QPlatformNativeInterface *nativeInterface() const Q_DECL_OVERRIDE; -#ifndef QT_NO_DRAGANDDROP +#if QT_CONFIG(draganddrop) QPlatformClipboard *clipboard() const Q_DECL_OVERRIDE; QPlatformDrag *drag() const Q_DECL_OVERRIDE; #endif @@ -94,7 +94,7 @@ public: QVariant styleHint(StyleHint hint) const Q_DECL_OVERRIDE; -#ifndef QT_NO_ACCESSIBILITY +#if QT_CONFIG(accessibility) QPlatformAccessibility *accessibility() const Q_DECL_OVERRIDE; #endif @@ -126,14 +126,14 @@ private: QWaylandShellIntegration *createShellIntegration(const QString& interfaceName); QScopedPointer mFontDb; -#ifndef QT_NO_DRAGANDDROP +#if QT_CONFIG(draganddrop) QScopedPointer mClipboard; QScopedPointer mDrag; #endif QScopedPointer mDisplay; QScopedPointer mNativeInterface; QScopedPointer mInputContext; -#ifndef QT_NO_ACCESSIBILITY +#if QT_CONFIG(accessibility) QScopedPointer mAccessibility; #endif bool mClientBufferIntegrationInitialized; diff --git a/src/client/qwaylandnativeinterface.cpp b/src/client/qwaylandnativeinterface.cpp index c0b675f7..9946c323 100644 --- a/src/client/qwaylandnativeinterface.cpp +++ b/src/client/qwaylandnativeinterface.cpp @@ -116,7 +116,7 @@ void *QWaylandNativeInterface::nativeResourceForScreen(const QByteArray &resourc return nullptr; } -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) void *QWaylandNativeInterface::nativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) { #if QT_CONFIG(opengl) @@ -134,7 +134,7 @@ void *QWaylandNativeInterface::nativeResourceForContext(const QByteArray &resour return nullptr; } -#endif // QT_NO_OPENGL +#endif // opengl QVariantMap QWaylandNativeInterface::windowProperties(QPlatformWindow *window) const { diff --git a/src/client/qwaylandnativeinterface_p.h b/src/client/qwaylandnativeinterface_p.h index 63a543ee..7b8b2834 100644 --- a/src/client/qwaylandnativeinterface_p.h +++ b/src/client/qwaylandnativeinterface_p.h @@ -72,7 +72,7 @@ public: QWindow *window) Q_DECL_OVERRIDE; void *nativeResourceForScreen(const QByteArray &resourceString, QScreen *screen) Q_DECL_OVERRIDE; -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) void *nativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) Q_DECL_OVERRIDE; #endif QVariantMap windowProperties(QPlatformWindow *window) const Q_DECL_OVERRIDE; diff --git a/src/client/qwaylandshmbackingstore.cpp b/src/client/qwaylandshmbackingstore.cpp index d0d6cfd3..0afdda4c 100644 --- a/src/client/qwaylandshmbackingstore.cpp +++ b/src/client/qwaylandshmbackingstore.cpp @@ -348,7 +348,7 @@ QWaylandWindow *QWaylandShmBackingStore::waylandWindow() const return static_cast(window()->handle()); } -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) QImage QWaylandShmBackingStore::toImage() const { // Invoked from QPlatformBackingStore::composeAndFlush() that is called @@ -357,7 +357,7 @@ QImage QWaylandShmBackingStore::toImage() const return *contentSurface(); } -#endif // QT_NO_OPENGL +#endif // opengl } diff --git a/src/client/qwaylandshmbackingstore_p.h b/src/client/qwaylandshmbackingstore_p.h index 5068519d..a5b809c7 100644 --- a/src/client/qwaylandshmbackingstore_p.h +++ b/src/client/qwaylandshmbackingstore_p.h @@ -107,7 +107,7 @@ public: QWaylandWindow *waylandWindow() const; void iterateBuffer(); -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) QImage toImage() const Q_DECL_OVERRIDE; #endif diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp index 8e40f3b3..d16746ba 100644 --- a/src/client/qwaylandwindow.cpp +++ b/src/client/qwaylandwindow.cpp @@ -795,7 +795,7 @@ void QWaylandWindow::requestActivateWindow() void QWaylandWindow::unfocus() { -#ifndef QT_NO_DRAGANDDROP +#if QT_CONFIG(draganddrop) QWaylandInputDevice *inputDevice = mDisplay->currentInputDevice(); if (inputDevice && inputDevice->dataDevice()) { inputDevice->dataDevice()->invalidateSelectionOffer(); diff --git a/src/client/shellintegration/qwaylandshellintegrationfactory.cpp b/src/client/shellintegration/qwaylandshellintegrationfactory.cpp index da622d13..8bee45c7 100644 --- a/src/client/shellintegration/qwaylandshellintegrationfactory.cpp +++ b/src/client/shellintegration/qwaylandshellintegrationfactory.cpp @@ -48,7 +48,7 @@ QT_BEGIN_NAMESPACE namespace QtWaylandClient { -#ifndef QT_NO_LIBRARY +#if QT_CONFIG(library) Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader, (QWaylandShellIntegrationFactoryInterface_iid, QLatin1String("/wayland-shell-integration"), Qt::CaseInsensitive)) Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, directLoader, @@ -57,7 +57,7 @@ Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, directLoader, QStringList QWaylandShellIntegrationFactory::keys(const QString &pluginPath) { -#ifndef QT_NO_LIBRARY +#if QT_CONFIG(library) QStringList list; if (!pluginPath.isEmpty()) { QCoreApplication::addLibraryPath(pluginPath); @@ -80,7 +80,7 @@ QStringList QWaylandShellIntegrationFactory::keys(const QString &pluginPath) QWaylandShellIntegration *QWaylandShellIntegrationFactory::create(const QString &name, const QStringList &args, const QString &pluginPath) { -#ifndef QT_NO_LIBRARY +#if QT_CONFIG(library) // Try loading the plugin from platformPluginPath first: if (!pluginPath.isEmpty()) { QCoreApplication::addLibraryPath(pluginPath); diff --git a/src/compositor/compositor_api/qwaylandinputmethodcontrol.cpp b/src/compositor/compositor_api/qwaylandinputmethodcontrol.cpp index 68279bb9..539fc1b7 100644 --- a/src/compositor/compositor_api/qwaylandinputmethodcontrol.cpp +++ b/src/compositor/compositor_api/qwaylandinputmethodcontrol.cpp @@ -54,7 +54,7 @@ QWaylandInputMethodControl::QWaylandInputMethodControl(QWaylandSurface *surface) if (textInput) { connect(textInput, &QWaylandTextInput::surfaceEnabled, this, &QWaylandInputMethodControl::surfaceEnabled); connect(textInput, &QWaylandTextInput::surfaceDisabled, this, &QWaylandInputMethodControl::surfaceDisabled); -#ifndef QT_NO_IM +#if QT_CONFIG(im) connect(textInput, &QWaylandTextInput::updateInputMethod, this, &QWaylandInputMethodControl::updateInputMethod); #endif } @@ -101,7 +101,7 @@ void QWaylandInputMethodControl::setEnabled(bool enabled) d->enabled = enabled; emit enabledChanged(enabled); -#ifndef QT_NO_IM +#if QT_CONFIG(im) emit updateInputMethod(Qt::ImQueryInput); #endif } diff --git a/src/compositor/compositor_api/qwaylandinputmethodcontrol.h b/src/compositor/compositor_api/qwaylandinputmethodcontrol.h index ab894c9c..af02e1ae 100644 --- a/src/compositor/compositor_api/qwaylandinputmethodcontrol.h +++ b/src/compositor/compositor_api/qwaylandinputmethodcontrol.h @@ -37,6 +37,7 @@ #ifndef QWAYLANDINPUTMETHODCONTROL_H #define QWAYLANDINPUTMETHODCONTROL_H +#include #include QT_BEGIN_NAMESPACE @@ -56,7 +57,7 @@ class QWaylandInputMethodControl : public QObject public: explicit QWaylandInputMethodControl(QWaylandSurface *surface); -#ifndef QT_NO_IM +#if QT_CONFIG(im) QVariant inputMethodQuery(Qt::InputMethodQuery query, QVariant argument) const; #endif @@ -69,7 +70,7 @@ public: Q_SIGNALS: void enabledChanged(bool enabled); -#ifndef QT_NO_IM +#if QT_CONFIG(im) void updateInputMethod(Qt::InputMethodQueries queries); #endif diff --git a/src/compositor/compositor_api/qwaylandquickitem.cpp b/src/compositor/compositor_api/qwaylandquickitem.cpp index 9bf42813..4c5bf075 100644 --- a/src/compositor/compositor_api/qwaylandquickitem.cpp +++ b/src/compositor/compositor_api/qwaylandquickitem.cpp @@ -667,7 +667,7 @@ void QWaylandQuickItem::touchEvent(QTouchEvent *event) } } -#ifndef QT_NO_IM +#if QT_CONFIG(im) /*! * \internal */ @@ -836,7 +836,7 @@ void QWaylandQuickItem::handleSurfaceChanged() disconnect(d->oldSurface, &QWaylandSurface::redraw, this, &QQuickItem::update); disconnect(d->oldSurface, &QWaylandSurface::childAdded, this, &QWaylandQuickItem::handleSubsurfaceAdded); disconnect(d->oldSurface, &QWaylandSurface::dragStarted, this, &QWaylandQuickItem::handleDragStarted); -#ifndef QT_NO_IM +#if QT_CONFIG(im) disconnect(d->oldSurface->inputMethodControl(), &QWaylandInputMethodControl::updateInputMethod, this, &QWaylandQuickItem::updateInputMethod); #endif } @@ -849,7 +849,7 @@ void QWaylandQuickItem::handleSurfaceChanged() connect(newSurface, &QWaylandSurface::redraw, this, &QQuickItem::update); connect(newSurface, &QWaylandSurface::childAdded, this, &QWaylandQuickItem::handleSubsurfaceAdded); connect(newSurface, &QWaylandSurface::dragStarted, this, &QWaylandQuickItem::handleDragStarted); -#ifndef QT_NO_IM +#if QT_CONFIG(im) connect(newSurface->inputMethodControl(), &QWaylandInputMethodControl::updateInputMethod, this, &QWaylandQuickItem::updateInputMethod); #endif @@ -866,7 +866,7 @@ void QWaylandQuickItem::handleSurfaceChanged() } surfaceChangedEvent(d->view->surface(), d->oldSurface); d->oldSurface = d->view->surface(); -#ifndef QT_NO_IM +#if QT_CONFIG(im) updateInputMethod(Qt::ImQueryInput); #endif } @@ -1013,7 +1013,7 @@ void QWaylandQuickItem::setSizeFollowsSurface(bool sizeFollowsSurface) emit sizeFollowsSurfaceChanged(); } -#ifndef QT_NO_IM +#if QT_CONFIG(im) QVariant QWaylandQuickItem::inputMethodQuery(Qt::InputMethodQuery query) const { return inputMethodQuery(query, QVariant()); @@ -1111,7 +1111,7 @@ void QWaylandQuickItem::beforeSync() } } -#ifndef QT_NO_IM +#if QT_CONFIG(im) void QWaylandQuickItem::updateInputMethod(Qt::InputMethodQueries queries) { Q_D(QWaylandQuickItem); diff --git a/src/compositor/compositor_api/qwaylandquickitem.h b/src/compositor/compositor_api/qwaylandquickitem.h index 524813c4..87d10b02 100644 --- a/src/compositor/compositor_api/qwaylandquickitem.h +++ b/src/compositor/compositor_api/qwaylandquickitem.h @@ -102,7 +102,7 @@ public: bool sizeFollowsSurface() const; void setSizeFollowsSurface(bool sizeFollowsSurface); -#ifndef QT_NO_IM +#if QT_CONFIG(im) QVariant inputMethodQuery(Qt::InputMethodQuery query) const Q_DECL_OVERRIDE; Q_INVOKABLE QVariant inputMethodQuery(Qt::InputMethodQuery query, QVariant argument) const; #endif @@ -135,7 +135,7 @@ protected: void touchEvent(QTouchEvent *event) Q_DECL_OVERRIDE; -#ifndef QT_NO_IM +#if QT_CONFIG(im) void inputMethodEvent(QInputMethodEvent *event) Q_DECL_OVERRIDE; #endif @@ -157,7 +157,7 @@ private Q_SLOTS: void handleSubsurfaceAdded(QWaylandSurface *childSurface); void handleSubsurfacePosition(const QPoint &pos); void handleDragStarted(QWaylandDrag *drag); -#ifndef QT_NO_IM +#if QT_CONFIG(im) void updateInputMethod(Qt::InputMethodQueries queries); #endif diff --git a/src/compositor/hardware_integration/qwlclientbufferintegrationfactory.cpp b/src/compositor/hardware_integration/qwlclientbufferintegrationfactory.cpp index 36ac56cf..e805f498 100644 --- a/src/compositor/hardware_integration/qwlclientbufferintegrationfactory.cpp +++ b/src/compositor/hardware_integration/qwlclientbufferintegrationfactory.cpp @@ -45,7 +45,7 @@ QT_BEGIN_NAMESPACE namespace QtWayland { -#ifndef QT_NO_LIBRARY +#if QT_CONFIG(library) Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader, (QtWaylandClientBufferIntegrationFactoryInterface_iid, QLatin1String("/wayland-graphics-integration-server"), Qt::CaseInsensitive)) Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, directLoader, @@ -54,7 +54,7 @@ Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, directLoader, QStringList ClientBufferIntegrationFactory::keys(const QString &pluginPath) { -#ifndef QT_NO_LIBRARY +#if QT_CONFIG(library) QStringList list; if (!pluginPath.isEmpty()) { QCoreApplication::addLibraryPath(pluginPath); @@ -77,7 +77,7 @@ QStringList ClientBufferIntegrationFactory::keys(const QString &pluginPath) ClientBufferIntegration *ClientBufferIntegrationFactory::create(const QString &name, const QStringList &args, const QString &pluginPath) { -#ifndef QT_NO_LIBRARY +#if QT_CONFIG(library) // Try loading the plugin from platformPluginPath first: if (!pluginPath.isEmpty()) { QCoreApplication::addLibraryPath(pluginPath); diff --git a/src/compositor/hardware_integration/qwlserverbufferintegrationfactory.cpp b/src/compositor/hardware_integration/qwlserverbufferintegrationfactory.cpp index 05f16e52..c366921f 100644 --- a/src/compositor/hardware_integration/qwlserverbufferintegrationfactory.cpp +++ b/src/compositor/hardware_integration/qwlserverbufferintegrationfactory.cpp @@ -45,7 +45,7 @@ QT_BEGIN_NAMESPACE namespace QtWayland { -#ifndef QT_NO_LIBRARY +#if QT_CONFIG(library) Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader, (QtWaylandServerBufferIntegrationFactoryInterface_iid, QLatin1String("/wayland-graphics-integration-server"), Qt::CaseInsensitive)) Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, directLoader, @@ -54,7 +54,7 @@ Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, directLoader, QStringList ServerBufferIntegrationFactory::keys(const QString &pluginPath) { -#ifndef QT_NO_LIBRARY +#if QT_CONFIG(library) QStringList list; if (!pluginPath.isEmpty()) { QCoreApplication::addLibraryPath(pluginPath); @@ -77,7 +77,7 @@ QStringList ServerBufferIntegrationFactory::keys(const QString &pluginPath) ServerBufferIntegration *ServerBufferIntegrationFactory::create(const QString &name, const QStringList &args, const QString &pluginPath) { -#ifndef QT_NO_LIBRARY +#if QT_CONFIG(library) // Try loading the plugin from platformPluginPath first: if (!pluginPath.isEmpty()) { QCoreApplication::addLibraryPath(pluginPath); diff --git a/src/plugins/decorations/bradient/main.cpp b/src/plugins/decorations/bradient/main.cpp index f7ce0fca..f57b816e 100644 --- a/src/plugins/decorations/bradient/main.cpp +++ b/src/plugins/decorations/bradient/main.cpp @@ -56,7 +56,7 @@ namespace QtWaylandClient { #define BUTTON_SPACING 5 -#ifndef QT_NO_IMAGEFORMAT_XPM +#if QT_CONFIG(imageformat_xpm) # define BUTTON_WIDTH 10 static const char * const qt_close_xpm[] = { @@ -265,7 +265,7 @@ void QWaylandBradientDecoration::paint(QPaintDevice *device) p.restore(); } -#ifndef QT_NO_IMAGEFORMAT_XPM +#if QT_CONFIG(imageformat_xpm) p.save(); // Close button -- cgit v1.2.1 From 36dcbb054ec84f6d93d755d905ad3d9bcadb2900 Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Tue, 22 Nov 2016 15:45:28 +0100 Subject: Fix crash on exit Make sure that QWaylandDrag and QWaylandClientBufferIntegration are destructed before the QWaylandDisplay. Change-Id: I606154c9861a51d7cf3e5afb16d4f805ab9368b8 Reviewed-by: Jan Arne Petersen Reviewed-by: Johan Helsing --- src/client/qwaylandintegration_p.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/client/qwaylandintegration_p.h b/src/client/qwaylandintegration_p.h index 39bd812d..1689581a 100644 --- a/src/client/qwaylandintegration_p.h +++ b/src/client/qwaylandintegration_p.h @@ -112,6 +112,11 @@ public: virtual QWaylandServerBufferIntegration *serverBufferIntegration() const; virtual QWaylandShellIntegration *shellIntegration() const; +private: + // NOTE: mDisplay *must* be destructed after mDrag and mClientBufferIntegration. + // Do not move this definition into the private section at the bottom. + QScopedPointer mDisplay; + protected: QScopedPointer mClientBufferIntegration; QScopedPointer mServerBufferIntegration; @@ -130,7 +135,6 @@ private: QScopedPointer mClipboard; QScopedPointer mDrag; #endif - QScopedPointer mDisplay; QScopedPointer mNativeInterface; QScopedPointer mInputContext; #if QT_CONFIG(accessibility) -- cgit v1.2.1