diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2020-01-18 03:05:18 +0100 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2020-01-18 03:05:18 +0100 |
commit | ec10511b6cef317a16de238585c73e063ef9cfd7 (patch) | |
tree | c28c2a0ab87d53007715f1c75f01197538519cf7 | |
parent | 59abce08c795e41608be7b77eb2c1800bf95004e (diff) | |
parent | 5a66bc64b0b157929c9fc76f0f4ae046393be600 (diff) |
Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: Ibd911372386f9f5fddb13afa05b84af6fe422fdd
-rw-r--r-- | qtwayland.pro | 2 | ||||
-rw-r--r-- | src/3rdparty/protocol/qt_attribution.json | 4 | ||||
-rw-r--r-- | src/3rdparty/protocol/xdg-output-unstable-v1.xml | 21 | ||||
-rw-r--r-- | src/client/configure.json | 19 | ||||
-rw-r--r-- | src/client/qwaylanddisplay.cpp | 2 | ||||
-rw-r--r-- | src/client/qwaylanddisplay_p.h | 6 | ||||
-rw-r--r-- | src/client/qwaylandscreen.cpp | 20 | ||||
-rw-r--r-- | src/client/qwaylandscreen_p.h | 10 | ||||
-rw-r--r-- | src/client/qwaylandshmbackingstore.cpp | 3 | ||||
-rw-r--r-- | src/compositor/compositor_api/qwaylandquickitem.cpp | 10 | ||||
-rw-r--r-- | src/compositor/compositor_api/qwaylandquickitem.h | 3 | ||||
-rw-r--r-- | src/compositor/extensions/qwaylandxdgshell.h | 4 | ||||
-rw-r--r-- | src/compositor/extensions/qwaylandxdgshellv6.h | 4 | ||||
-rw-r--r-- | src/hardwareintegration/client/drm-egl-server/drmeglserverbufferintegration.cpp | 4 | ||||
-rw-r--r-- | src/hardwareintegration/client/wayland-egl/qwaylandeglclientbufferintegration.cpp | 4 | ||||
-rw-r--r-- | src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp | 6 |
16 files changed, 96 insertions, 26 deletions
diff --git a/qtwayland.pro b/qtwayland.pro index fdcc3e24f..1dfa06aee 100644 --- a/qtwayland.pro +++ b/qtwayland.pro @@ -1,3 +1,3 @@ -requires(linux:!android|macos) +requires(linux:!android|macos|qnx) requires(qtHaveModule(gui)) load(qt_parts) diff --git a/src/3rdparty/protocol/qt_attribution.json b/src/3rdparty/protocol/qt_attribution.json index afbcbc27d..ddda0e971 100644 --- a/src/3rdparty/protocol/qt_attribution.json +++ b/src/3rdparty/protocol/qt_attribution.json @@ -150,8 +150,8 @@ Copyright 2015-2016 © Red Hat, Inc." "Description": "The XDG Output protocol is an extended way to describe output regions under Wayland", "Homepage": "https://wayland.freedesktop.org", - "Version": "unstable v1, version 2", - "DownloadLocation": "https://gitlab.freedesktop.org/wayland/wayland-protocols/raw/1.17/unstable/xdg-output/xdg-output-unstable-v1.xml", + "Version": "unstable v1, version 3", + "DownloadLocation": "https://gitlab.freedesktop.org/wayland/wayland-protocols/raw/1.18/unstable/xdg-output/xdg-output-unstable-v1.xml", "LicenseId": "MIT", "License": "MIT License", "LicenseFile": "MIT_LICENSE.txt", diff --git a/src/3rdparty/protocol/xdg-output-unstable-v1.xml b/src/3rdparty/protocol/xdg-output-unstable-v1.xml index ccbfe1c9a..fe3a70aab 100644 --- a/src/3rdparty/protocol/xdg-output-unstable-v1.xml +++ b/src/3rdparty/protocol/xdg-output-unstable-v1.xml @@ -54,7 +54,7 @@ reset. </description> - <interface name="zxdg_output_manager_v1" version="2"> + <interface name="zxdg_output_manager_v1" version="3"> <description summary="manage xdg_output objects"> A global factory interface for xdg_output objects. </description> @@ -77,12 +77,17 @@ </request> </interface> - <interface name="zxdg_output_v1" version="2"> + <interface name="zxdg_output_v1" version="3"> <description summary="compositor logical output region"> An xdg_output describes part of the compositor geometry. This typically corresponds to a monitor that displays part of the compositor space. + + For objects version 3 onwards, after all xdg_output properties have been + sent (when the object is created and when properties are updated), a + wl_output.done event is sent. This allows changes to the output + properties to be seen as atomic, even if they happen via multiple events. </description> <request name="destroy" type="destructor"> @@ -157,6 +162,10 @@ This allows changes to the xdg_output properties to be seen as atomic, even if they happen via multiple events. + + For objects version 3 onwards, this event is deprecated. Compositors + are not required to send it anymore and must send wl_output.done + instead. </description> </event> @@ -197,10 +206,12 @@ output via :1'. The description event is sent after creating an xdg_output (see - xdg_output_manager.get_xdg_output). This event is only sent once per + xdg_output_manager.get_xdg_output) and whenever the description + changes. The description is optional, and may not be sent at all. + + For objects of version 2 and lower, this event is only sent once per xdg_output, and the description does not change over the lifetime of - the wl_output global. The description is optional, and may not be sent - at all. + the wl_output global. </description> <arg name="description" type="string" summary="output description"/> </event> diff --git a/src/client/configure.json b/src/client/configure.json index 7d4468240..9b8b43457 100644 --- a/src/client/configure.json +++ b/src/client/configure.json @@ -168,6 +168,21 @@ "return 0;" ] } + }, + "egl_1_5-wayland": { + "label": "EGL 1.5 with Wayland Platform", + "type": "compile", + "test": { + "include": [ + "EGL/egl.h", + "EGL/eglext.h", + "wayland-client.h" + ], + "main": [ + "eglGetPlatformDisplay(EGL_PLATFORM_WAYLAND_EXT, (struct wl_display *)(nullptr), nullptr);" + ] + }, + "use": "egl" } }, @@ -218,7 +233,7 @@ }, "wayland-egl": { "label": "EGL", - "condition": "features.wayland-client && features.opengl && features.egl && libs.wayland-egl", + "condition": "features.wayland-client && features.opengl && features.egl && libs.wayland-egl && (!config.qnx || tests.egl_1_5-wayland)", "output": [ "privateFeature" ] }, "wayland-brcm": { @@ -238,7 +253,7 @@ }, "wayland-drm-egl-server-buffer": { "label": "DRM EGL", - "condition": "features.wayland-client && features.opengl && features.egl && tests.drm-egl-server", + "condition": "features.wayland-client && features.opengl && features.egl && tests.drm-egl-server && (!config.qnx || tests.egl_1_5-wayland)", "output": [ "privateFeature" ] }, "wayland-libhybris-egl-server-buffer": { diff --git a/src/client/qwaylanddisplay.cpp b/src/client/qwaylanddisplay.cpp index ffcc72ff9..37cb0e9bc 100644 --- a/src/client/qwaylanddisplay.cpp +++ b/src/client/qwaylanddisplay.cpp @@ -351,7 +351,7 @@ void QWaylandDisplay::registry_global(uint32_t id, const QString &interface, uin forceRoundTrip(); } } else if (interface == QLatin1String("zxdg_output_manager_v1")) { - mXdgOutputManager.reset(new QtWayland::zxdg_output_manager_v1(registry, id, qMin(2, int(version)))); + mXdgOutputManager.reset(new QWaylandXdgOutputManagerV1(this, id, version)); for (auto *screen : qAsConst(mWaitingScreens)) screen->initXdgOutput(xdgOutputManager()); forceRoundTrip(); diff --git a/src/client/qwaylanddisplay_p.h b/src/client/qwaylanddisplay_p.h index e99ec1983..a52c89fe9 100644 --- a/src/client/qwaylanddisplay_p.h +++ b/src/client/qwaylanddisplay_p.h @@ -81,7 +81,6 @@ class QPlatformPlaceholderScreen; namespace QtWayland { class qt_surface_extension; class zwp_text_input_manager_v2; - class zxdg_output_manager_v1; } namespace QtWaylandClient { @@ -91,6 +90,7 @@ Q_WAYLAND_CLIENT_EXPORT Q_DECLARE_LOGGING_CATEGORY(lcQpaWayland); class QWaylandInputDevice; class QWaylandBuffer; class QWaylandScreen; +class QWaylandXdgOutputManagerV1; class QWaylandClientBufferIntegration; class QWaylandWindowManagerIntegration; class QWaylandDataDeviceManager; @@ -165,7 +165,7 @@ public: QWaylandTouchExtension *touchExtension() const { return mTouchExtension.data(); } QtWayland::zwp_text_input_manager_v2 *textInputManager() const { return mTextInputManager.data(); } QWaylandHardwareIntegration *hardwareIntegration() const { return mHardwareIntegration.data(); } - QtWayland::zxdg_output_manager_v1 *xdgOutputManager() const { return mXdgOutputManager.data(); } + QWaylandXdgOutputManagerV1 *xdgOutputManager() const { return mXdgOutputManager.data(); } bool usingInputContextFromCompositor() const { return mUsingInputContextFromCompositor; } @@ -255,7 +255,7 @@ private: #endif QScopedPointer<QtWayland::zwp_text_input_manager_v2> mTextInputManager; QScopedPointer<QWaylandHardwareIntegration> mHardwareIntegration; - QScopedPointer<QtWayland::zxdg_output_manager_v1> mXdgOutputManager; + QScopedPointer<QWaylandXdgOutputManagerV1> mXdgOutputManager; QSocketNotifier *mReadNotifier = nullptr; int mFd = -1; int mWritableNotificationFd = -1; diff --git a/src/client/qwaylandscreen.cpp b/src/client/qwaylandscreen.cpp index 4f0cd9b0a..6cb337de3 100644 --- a/src/client/qwaylandscreen.cpp +++ b/src/client/qwaylandscreen.cpp @@ -53,6 +53,12 @@ QT_BEGIN_NAMESPACE namespace QtWaylandClient { +QWaylandXdgOutputManagerV1::QWaylandXdgOutputManagerV1(QWaylandDisplay* display, uint id, uint version) + : QtWayland::zxdg_output_manager_v1(display->wl_registry(), id, qMin(3u, version)) + , m_version(qMin(3u, version)) +{ +} + QWaylandScreen::QWaylandScreen(QWaylandDisplay *waylandDisplay, int version, uint32_t id) : QtWayland::wl_output(waylandDisplay->wl_registry(), id, qMin(version, 2)) , m_outputId(id) @@ -95,7 +101,7 @@ void QWaylandScreen::maybeInitialize() updateXdgOutputProperties(); } -void QWaylandScreen::initXdgOutput(QtWayland::zxdg_output_manager_v1 *xdgOutputManager) +void QWaylandScreen::initXdgOutput(QWaylandXdgOutputManagerV1 *xdgOutputManager) { Q_ASSERT(xdgOutputManager); if (zxdg_output_v1::isInitialized()) @@ -271,10 +277,15 @@ void QWaylandScreen::output_scale(int32_t factor) void QWaylandScreen::output_done() { mOutputDone = true; - if (mInitialized) + if (zxdg_output_v1::isInitialized() && mWaylandDisplay->xdgOutputManager()->version() >= 3) + mXdgOutputDone = true; + if (mInitialized) { updateOutputProperties(); - else + if (zxdg_output_v1::isInitialized()) + updateXdgOutputProperties(); + } else { maybeInitialize(); + } } void QWaylandScreen::updateOutputProperties() @@ -325,6 +336,9 @@ void QWaylandScreen::zxdg_output_v1_logical_size(int32_t width, int32_t height) void QWaylandScreen::zxdg_output_v1_done() { + if (Q_UNLIKELY(mWaylandDisplay->xdgOutputManager()->version() >= 3)) + qWarning(lcQpaWayland) << "zxdg_output_v1.done received on version 3 or newer, this is most likely a bug in the compositor"; + mXdgOutputDone = true; if (mInitialized) updateXdgOutputProperties(); diff --git a/src/client/qwaylandscreen_p.h b/src/client/qwaylandscreen_p.h index ae91c6211..df1c94f24 100644 --- a/src/client/qwaylandscreen_p.h +++ b/src/client/qwaylandscreen_p.h @@ -64,6 +64,14 @@ namespace QtWaylandClient { class QWaylandDisplay; class QWaylandCursor; +class Q_WAYLAND_CLIENT_EXPORT QWaylandXdgOutputManagerV1 : public QtWayland::zxdg_output_manager_v1 { +public: + QWaylandXdgOutputManagerV1(QWaylandDisplay *display, uint id, uint version); + uint version() const { return m_version; } +private: + uint m_version = 1; // TODO: remove when we upgrade minimum libwayland requriement to 1.10 +}; + class Q_WAYLAND_CLIENT_EXPORT QWaylandScreen : public QPlatformScreen, QtWayland::wl_output, QtWayland::zxdg_output_v1 { public: @@ -72,7 +80,7 @@ public: void maybeInitialize(); - void initXdgOutput(QtWayland::zxdg_output_manager_v1 *xdgOutputManager); + void initXdgOutput(QWaylandXdgOutputManagerV1 *xdgOutputManager); QWaylandDisplay *display() const; diff --git a/src/client/qwaylandshmbackingstore.cpp b/src/client/qwaylandshmbackingstore.cpp index 8d5b977d5..dc7ff6708 100644 --- a/src/client/qwaylandshmbackingstore.cpp +++ b/src/client/qwaylandshmbackingstore.cpp @@ -47,6 +47,7 @@ #include <QtCore/qstandardpaths.h> #include <QtCore/qtemporaryfile.h> #include <QtGui/QPainter> +#include <QtGui/QTransform> #include <QMutexLocker> #include <QtWaylandClient/private/wayland-wayland-client-protocol.h> @@ -328,7 +329,7 @@ void QWaylandShmBackingStore::updateDecorations() qreal dp = sourceImage.devicePixelRatio(); int dpWidth = int(sourceImage.width() / dp); int dpHeight = int(sourceImage.height() / dp); - QMatrix sourceMatrix; + QTransform sourceMatrix; sourceMatrix.scale(dp, dp); QRect target; // needs to be in device independent pixels diff --git a/src/compositor/compositor_api/qwaylandquickitem.cpp b/src/compositor/compositor_api/qwaylandquickitem.cpp index 354b33bd9..c74548d4b 100644 --- a/src/compositor/compositor_api/qwaylandquickitem.cpp +++ b/src/compositor/compositor_api/qwaylandquickitem.cpp @@ -413,11 +413,14 @@ QWaylandSurface *QWaylandQuickItem::surface() const void QWaylandQuickItem::setSurface(QWaylandSurface *surface) { Q_D(QWaylandQuickItem); + QWaylandSurface *oldSurf = d->view->surface(); QWaylandCompositor *oldComp = d->view->surface() ? d->view->surface()->compositor() : nullptr; d->view->setSurface(surface); QWaylandCompositor *newComp = d->view->surface() ? d->view->surface()->compositor() : nullptr; if (oldComp != newComp) emit compositorChanged(); + if (oldSurf != surface) + emit surfaceChanged(); update(); } @@ -1153,7 +1156,12 @@ bool QWaylandQuickItem::paintEnabled() const void QWaylandQuickItem::setPaintEnabled(bool enabled) { Q_D(QWaylandQuickItem); - d->paintEnabled = enabled; + + if (enabled != d->paintEnabled) { + d->paintEnabled = enabled; + emit paintEnabledChanged(); + } + update(); } diff --git a/src/compositor/compositor_api/qwaylandquickitem.h b/src/compositor/compositor_api/qwaylandquickitem.h index eaa282e90..0767e7ec6 100644 --- a/src/compositor/compositor_api/qwaylandquickitem.h +++ b/src/compositor/compositor_api/qwaylandquickitem.h @@ -53,7 +53,7 @@ class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandQuickItem : public QQuickItem Q_DECLARE_PRIVATE(QWaylandQuickItem) Q_PROPERTY(QWaylandCompositor *compositor READ compositor NOTIFY compositorChanged) Q_PROPERTY(QWaylandSurface *surface READ surface WRITE setSurface NOTIFY surfaceChanged) - Q_PROPERTY(bool paintEnabled READ paintEnabled WRITE setPaintEnabled) + Q_PROPERTY(bool paintEnabled READ paintEnabled WRITE setPaintEnabled NOTIFY paintEnabledChanged) Q_PROPERTY(bool touchEventsEnabled READ touchEventsEnabled WRITE setTouchEventsEnabled NOTIFY touchEventsEnabledChanged) Q_PROPERTY(QWaylandSurface::Origin origin READ origin NOTIFY originChanged) Q_PROPERTY(bool inputEventsEnabled READ inputEventsEnabled WRITE setInputEventsEnabled NOTIFY inputEventsEnabledChanged) @@ -163,6 +163,7 @@ private Q_SLOTS: Q_SIGNALS: void surfaceChanged(); void compositorChanged(); + void paintEnabledChanged(); void touchEventsEnabledChanged(); void originChanged(); void surfaceDestroyed(); diff --git a/src/compositor/extensions/qwaylandxdgshell.h b/src/compositor/extensions/qwaylandxdgshell.h index c79b22350..0535f8e4d 100644 --- a/src/compositor/extensions/qwaylandxdgshell.h +++ b/src/compositor/extensions/qwaylandxdgshell.h @@ -234,8 +234,8 @@ class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandXdgPopup : public QObject { Q_OBJECT Q_DECLARE_PRIVATE(QWaylandXdgPopup) - Q_PROPERTY(QWaylandXdgSurface *xdgSurface READ xdgSurface) - Q_PROPERTY(QWaylandXdgSurface *parentXdgSurface READ parentXdgSurface) + Q_PROPERTY(QWaylandXdgSurface *xdgSurface READ xdgSurface CONSTANT) + Q_PROPERTY(QWaylandXdgSurface *parentXdgSurface READ parentXdgSurface CONSTANT) Q_PROPERTY(QRect configuredGeometry READ configuredGeometry NOTIFY configuredGeometryChanged) // Positioner properties diff --git a/src/compositor/extensions/qwaylandxdgshellv6.h b/src/compositor/extensions/qwaylandxdgshellv6.h index 71f82521a..f280880bc 100644 --- a/src/compositor/extensions/qwaylandxdgshellv6.h +++ b/src/compositor/extensions/qwaylandxdgshellv6.h @@ -215,8 +215,8 @@ class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandXdgPopupV6 : public QObject { Q_OBJECT Q_DECLARE_PRIVATE(QWaylandXdgPopupV6) - Q_PROPERTY(QWaylandXdgSurfaceV6 *xdgSurface READ xdgSurface) - Q_PROPERTY(QWaylandXdgSurfaceV6 *parentXdgSurface READ parentXdgSurface) + Q_PROPERTY(QWaylandXdgSurfaceV6 *xdgSurface READ xdgSurface CONSTANT) + Q_PROPERTY(QWaylandXdgSurfaceV6 *parentXdgSurface READ parentXdgSurface CONSTANT) Q_PROPERTY(QRect configuredGeometry READ configuredGeometry NOTIFY configuredGeometryChanged) // Positioner properties diff --git a/src/hardwareintegration/client/drm-egl-server/drmeglserverbufferintegration.cpp b/src/hardwareintegration/client/drm-egl-server/drmeglserverbufferintegration.cpp index 754196468..42c85f7db 100644 --- a/src/hardwareintegration/client/drm-egl-server/drmeglserverbufferintegration.cpp +++ b/src/hardwareintegration/client/drm-egl-server/drmeglserverbufferintegration.cpp @@ -125,7 +125,11 @@ void DrmEglServerBufferIntegration::initializeEgl() return; m_egl_initialized = true; +#if defined(EGL_VERSION_1_5) && defined(EGL_PLATFORM_WAYLAND_EXT) + m_egl_display = eglGetPlatformDisplay(EGL_PLATFORM_WAYLAND_EXT, m_display->wl_display(), nullptr); +#else m_egl_display = eglGetDisplay((EGLNativeDisplayType) m_display->wl_display()); +#endif if (m_egl_display == EGL_NO_DISPLAY) { qWarning("Failed to initialize drm egl server buffer integration. Could not get egl display from wl_display."); return; diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandeglclientbufferintegration.cpp b/src/hardwareintegration/client/wayland-egl/qwaylandeglclientbufferintegration.cpp index bdd005db6..6bd2f76e3 100644 --- a/src/hardwareintegration/client/wayland-egl/qwaylandeglclientbufferintegration.cpp +++ b/src/hardwareintegration/client/wayland-egl/qwaylandeglclientbufferintegration.cpp @@ -76,6 +76,9 @@ QWaylandEglClientBufferIntegration::~QWaylandEglClientBufferIntegration() void QWaylandEglClientBufferIntegration::initialize(QWaylandDisplay *display) { +#if defined(EGL_VERSION_1_5) && defined(EGL_PLATFORM_WAYLAND_EXT) + m_eglDisplay = eglGetPlatformDisplay(EGL_PLATFORM_WAYLAND_EXT, display->wl_display(), nullptr); +#else if (q_hasEglExtension(EGL_NO_DISPLAY, "EGL_EXT_platform_base")) { if (q_hasEglExtension(EGL_NO_DISPLAY, "EGL_KHR_platform_wayland") || q_hasEglExtension(EGL_NO_DISPLAY, "EGL_EXT_platform_wayland") || @@ -98,6 +101,7 @@ void QWaylandEglClientBufferIntegration::initialize(QWaylandDisplay *display) m_eglDisplay = eglGetDisplay((EGLNativeDisplayType) display->wl_display()); } +#endif m_display = display; diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp index 7679a5fb3..8ea8e1092 100644 --- a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp +++ b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp @@ -346,7 +346,11 @@ void QWaylandGLContext::updateGLFormat() wl_surface *wlSurface = m_display->createSurface(nullptr); wl_egl_window *eglWindow = wl_egl_window_create(wlSurface, 1, 1); - EGLSurface eglSurface = eglCreateWindowSurface(m_eglDisplay, m_config, eglWindow, 0); +#if defined(EGL_VERSION_1_5) + EGLSurface eglSurface = eglCreatePlatformWindowSurface(m_eglDisplay, m_config, eglWindow, nullptr); +#else + EGLSurface eglSurface = eglCreateWindowSurface(m_eglDisplay, m_config, eglWindow, nullptr); +#endif if (eglMakeCurrent(m_eglDisplay, eglSurface, eglSurface, m_context)) { if (m_format.renderableType() == QSurfaceFormat::OpenGL |