Merge remote-tracking branch 'origin/5.15' into dev

Change-Id: Ibd911372386f9f5fddb13afa05b84af6fe422fdd
This commit is contained in:
Qt Forward Merge Bot 2020-01-18 03:05:18 +01:00
commit 6c26a60a72
8 changed files with 67 additions and 18 deletions

View File

@ -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", "Description": "The XDG Output protocol is an extended way to describe output regions under Wayland",
"Homepage": "https://wayland.freedesktop.org", "Homepage": "https://wayland.freedesktop.org",
"Version": "unstable v1, version 2", "Version": "unstable v1, version 3",
"DownloadLocation": "https://gitlab.freedesktop.org/wayland/wayland-protocols/raw/1.17/unstable/xdg-output/xdg-output-unstable-v1.xml", "DownloadLocation": "https://gitlab.freedesktop.org/wayland/wayland-protocols/raw/1.18/unstable/xdg-output/xdg-output-unstable-v1.xml",
"LicenseId": "MIT", "LicenseId": "MIT",
"License": "MIT License", "License": "MIT License",
"LicenseFile": "MIT_LICENSE.txt", "LicenseFile": "MIT_LICENSE.txt",

View File

@ -54,7 +54,7 @@
reset. reset.
</description> </description>
<interface name="zxdg_output_manager_v1" version="2"> <interface name="zxdg_output_manager_v1" version="3">
<description summary="manage xdg_output objects"> <description summary="manage xdg_output objects">
A global factory interface for xdg_output objects. A global factory interface for xdg_output objects.
</description> </description>
@ -77,12 +77,17 @@
</request> </request>
</interface> </interface>
<interface name="zxdg_output_v1" version="2"> <interface name="zxdg_output_v1" version="3">
<description summary="compositor logical output region"> <description summary="compositor logical output region">
An xdg_output describes part of the compositor geometry. An xdg_output describes part of the compositor geometry.
This typically corresponds to a monitor that displays part of the This typically corresponds to a monitor that displays part of the
compositor space. 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> </description>
<request name="destroy" type="destructor"> <request name="destroy" type="destructor">
@ -157,6 +162,10 @@
This allows changes to the xdg_output properties to be seen as This allows changes to the xdg_output properties to be seen as
atomic, even if they happen via multiple events. 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> </description>
</event> </event>
@ -197,10 +206,12 @@
output via :1'. output via :1'.
The description event is sent after creating an xdg_output (see 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 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 the wl_output global.
at all.
</description> </description>
<arg name="description" type="string" summary="output description"/> <arg name="description" type="string" summary="output description"/>
</event> </event>

View File

@ -168,6 +168,21 @@
"return 0;" "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": { "wayland-egl": {
"label": "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" ] "output": [ "privateFeature" ]
}, },
"wayland-brcm": { "wayland-brcm": {
@ -238,7 +253,7 @@
}, },
"wayland-drm-egl-server-buffer": { "wayland-drm-egl-server-buffer": {
"label": "DRM EGL", "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" ] "output": [ "privateFeature" ]
}, },
"wayland-libhybris-egl-server-buffer": { "wayland-libhybris-egl-server-buffer": {

View File

@ -351,7 +351,7 @@ void QWaylandDisplay::registry_global(uint32_t id, const QString &interface, uin
forceRoundTrip(); forceRoundTrip();
} }
} else if (interface == QLatin1String("zxdg_output_manager_v1")) { } 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)) for (auto *screen : qAsConst(mWaitingScreens))
screen->initXdgOutput(xdgOutputManager()); screen->initXdgOutput(xdgOutputManager());
forceRoundTrip(); forceRoundTrip();

View File

@ -81,7 +81,6 @@ class QPlatformPlaceholderScreen;
namespace QtWayland { namespace QtWayland {
class qt_surface_extension; class qt_surface_extension;
class zwp_text_input_manager_v2; class zwp_text_input_manager_v2;
class zxdg_output_manager_v1;
} }
namespace QtWaylandClient { namespace QtWaylandClient {
@ -91,6 +90,7 @@ Q_WAYLAND_CLIENT_EXPORT Q_DECLARE_LOGGING_CATEGORY(lcQpaWayland);
class QWaylandInputDevice; class QWaylandInputDevice;
class QWaylandBuffer; class QWaylandBuffer;
class QWaylandScreen; class QWaylandScreen;
class QWaylandXdgOutputManagerV1;
class QWaylandClientBufferIntegration; class QWaylandClientBufferIntegration;
class QWaylandWindowManagerIntegration; class QWaylandWindowManagerIntegration;
class QWaylandDataDeviceManager; class QWaylandDataDeviceManager;
@ -165,7 +165,7 @@ public:
QWaylandTouchExtension *touchExtension() const { return mTouchExtension.data(); } QWaylandTouchExtension *touchExtension() const { return mTouchExtension.data(); }
QtWayland::zwp_text_input_manager_v2 *textInputManager() const { return mTextInputManager.data(); } QtWayland::zwp_text_input_manager_v2 *textInputManager() const { return mTextInputManager.data(); }
QWaylandHardwareIntegration *hardwareIntegration() const { return mHardwareIntegration.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; } bool usingInputContextFromCompositor() const { return mUsingInputContextFromCompositor; }
@ -255,7 +255,7 @@ private:
#endif #endif
QScopedPointer<QtWayland::zwp_text_input_manager_v2> mTextInputManager; QScopedPointer<QtWayland::zwp_text_input_manager_v2> mTextInputManager;
QScopedPointer<QWaylandHardwareIntegration> mHardwareIntegration; QScopedPointer<QWaylandHardwareIntegration> mHardwareIntegration;
QScopedPointer<QtWayland::zxdg_output_manager_v1> mXdgOutputManager; QScopedPointer<QWaylandXdgOutputManagerV1> mXdgOutputManager;
QSocketNotifier *mReadNotifier = nullptr; QSocketNotifier *mReadNotifier = nullptr;
int mFd = -1; int mFd = -1;
int mWritableNotificationFd = -1; int mWritableNotificationFd = -1;

View File

@ -53,6 +53,12 @@ QT_BEGIN_NAMESPACE
namespace QtWaylandClient { 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) QWaylandScreen::QWaylandScreen(QWaylandDisplay *waylandDisplay, int version, uint32_t id)
: QtWayland::wl_output(waylandDisplay->wl_registry(), id, qMin(version, 2)) : QtWayland::wl_output(waylandDisplay->wl_registry(), id, qMin(version, 2))
, m_outputId(id) , m_outputId(id)
@ -95,7 +101,7 @@ void QWaylandScreen::maybeInitialize()
updateXdgOutputProperties(); updateXdgOutputProperties();
} }
void QWaylandScreen::initXdgOutput(QtWayland::zxdg_output_manager_v1 *xdgOutputManager) void QWaylandScreen::initXdgOutput(QWaylandXdgOutputManagerV1 *xdgOutputManager)
{ {
Q_ASSERT(xdgOutputManager); Q_ASSERT(xdgOutputManager);
if (zxdg_output_v1::isInitialized()) if (zxdg_output_v1::isInitialized())
@ -271,10 +277,15 @@ void QWaylandScreen::output_scale(int32_t factor)
void QWaylandScreen::output_done() void QWaylandScreen::output_done()
{ {
mOutputDone = true; mOutputDone = true;
if (mInitialized) if (zxdg_output_v1::isInitialized() && mWaylandDisplay->xdgOutputManager()->version() >= 3)
mXdgOutputDone = true;
if (mInitialized) {
updateOutputProperties(); updateOutputProperties();
else if (zxdg_output_v1::isInitialized())
updateXdgOutputProperties();
} else {
maybeInitialize(); maybeInitialize();
}
} }
void QWaylandScreen::updateOutputProperties() 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() 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; mXdgOutputDone = true;
if (mInitialized) if (mInitialized)
updateXdgOutputProperties(); updateXdgOutputProperties();

View File

@ -64,6 +64,14 @@ namespace QtWaylandClient {
class QWaylandDisplay; class QWaylandDisplay;
class QWaylandCursor; 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 class Q_WAYLAND_CLIENT_EXPORT QWaylandScreen : public QPlatformScreen, QtWayland::wl_output, QtWayland::zxdg_output_v1
{ {
public: public:
@ -72,7 +80,7 @@ public:
void maybeInitialize(); void maybeInitialize();
void initXdgOutput(QtWayland::zxdg_output_manager_v1 *xdgOutputManager); void initXdgOutput(QWaylandXdgOutputManagerV1 *xdgOutputManager);
QWaylandDisplay *display() const; QWaylandDisplay *display() const;

View File

@ -47,6 +47,7 @@
#include <QtCore/qstandardpaths.h> #include <QtCore/qstandardpaths.h>
#include <QtCore/qtemporaryfile.h> #include <QtCore/qtemporaryfile.h>
#include <QtGui/QPainter> #include <QtGui/QPainter>
#include <QtGui/QTransform>
#include <QMutexLocker> #include <QMutexLocker>
#include <QtWaylandClient/private/wayland-wayland-client-protocol.h> #include <QtWaylandClient/private/wayland-wayland-client-protocol.h>
@ -328,7 +329,7 @@ void QWaylandShmBackingStore::updateDecorations()
qreal dp = sourceImage.devicePixelRatio(); qreal dp = sourceImage.devicePixelRatio();
int dpWidth = int(sourceImage.width() / dp); int dpWidth = int(sourceImage.width() / dp);
int dpHeight = int(sourceImage.height() / dp); int dpHeight = int(sourceImage.height() / dp);
QMatrix sourceMatrix; QTransform sourceMatrix;
sourceMatrix.scale(dp, dp); sourceMatrix.scale(dp, dp);
QRect target; // needs to be in device independent pixels QRect target; // needs to be in device independent pixels