diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2020-05-14 14:09:26 +0200 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2020-05-14 14:09:27 +0200 |
commit | 76eda41dab9ddccf4c2a38d981c9b03bc7f051d0 (patch) | |
tree | 21d4e7d661dbb383d61cc79c243ac05a6b28dd9d | |
parent | 1a5b7938c1384381a482448cf079bc682395b54b (diff) | |
parent | efc94a48526baf92b8a78916e03e1fef5993fa95 (diff) | |
download | qtwayland-76eda41dab9ddccf4c2a38d981c9b03bc7f051d0.tar.gz |
Merge remote-tracking branch 'origin/5.15.0' into 5.15
Change-Id: I7341fbfbe7c3eeae44a7fea0bf534fda1180ac51
-rw-r--r-- | dist/changes-5.15.0 | 48 | ||||
-rw-r--r-- | src/client/qwaylandintegration.cpp | 7 | ||||
-rw-r--r-- | src/client/qwaylandwindow.cpp | 59 | ||||
-rw-r--r-- | src/client/qwaylandwindow_p.h | 5 | ||||
-rw-r--r-- | src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp | 7 | ||||
-rw-r--r-- | src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.h | 1 |
6 files changed, 83 insertions, 44 deletions
diff --git a/dist/changes-5.15.0 b/dist/changes-5.15.0 new file mode 100644 index 00000000..5ad06943 --- /dev/null +++ b/dist/changes-5.15.0 @@ -0,0 +1,48 @@ +Qt 5.15 introduces many new features and improvements as well as bugfixes +over the 5.14.x series. For more details, refer to the online documentation +included in this distribution. The documentation is also available online: + +https://doc.qt.io/qt-5/index.html + +The Qt version 5.15 series is binary compatible with the 5.14.x series. +Applications compiled for 5.14 will continue to run with 5.15. + +Some of the changes listed in this file include issue tracking numbers +corresponding to tasks in the Qt Bug Tracker: + +https://bugreports.qt.io/ + +Each of these identifiers can be entered in the bug tracker to obtain more +information about a particular change. + +**************************************************************************** +* Compositor * +**************************************************************************** + + - XdgShellV5 and XdgShellV6 are now deprecated: use XdgShell instead. + - Fixed QML bindings for some properties + +**************************************************************************** +* QPA plugin * +**************************************************************************** + + - Added Vulkan support. + - Added QNX support. + - The QPA plugin now supports running with no screens attached. This is + handled by adding a fake screen when the last screen is disconnected, + similarly to what the other QPA plugins do. + - Added support for drawing tablets through the tablet-unstable-v2 + protocol. + - xdg-output-unstable-v1 version 3 is now supported. + - Windows with Qt::FramelessWindowHint no longer create + zxdg_toplevel_decoration_v1, as that allowed compositors to force + server-side decorations. + - The QPA plugin will now use the same platform themes as the xcb plugin. + - Fixed a bug in font gamma correction making text appear too dark. + +**************************************************************************** +* qtwaylandscanner * +**************************************************************************** + + - There is now a comment on top of the generated file, explaining what xml + file is being represented. diff --git a/src/client/qwaylandintegration.cpp b/src/client/qwaylandintegration.cpp index e3b86ee9..7ad8e05e 100644 --- a/src/client/qwaylandintegration.cpp +++ b/src/client/qwaylandintegration.cpp @@ -233,13 +233,6 @@ QVariant QWaylandIntegration::styleHint(StyleHint hint) const if (hint == ShowIsFullScreen && mDisplay->windowManagerIntegration()) return mDisplay->windowManagerIntegration()->showIsFullScreen(); - switch (hint) { - case QPlatformIntegration::FontSmoothingGamma: - return qreal(1.0); - default: - break; - } - return QPlatformIntegration::styleHint(hint); } diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp index 5830c136..0545c80f 100644 --- a/src/client/qwaylandwindow.cpp +++ b/src/client/qwaylandwindow.cpp @@ -79,6 +79,13 @@ QWaylandWindow::QWaylandWindow(QWindow *window, QWaylandDisplay *display) , mFrameQueue(mDisplay->createEventQueue()) , mResizeAfterSwap(qEnvironmentVariableIsSet("QT_WAYLAND_RESIZE_AFTER_SWAP")) { + { + bool ok; + int frameCallbackTimeout = qEnvironmentVariableIntValue("QT_WAYLAND_FRAME_CALLBACK_TIMEOUT", &ok); + if (ok) + mFrameCallbackTimeout = frameCallbackTimeout; + } + static WId id = 1; mWindowId = id++; initializeWlSurface(); @@ -244,6 +251,8 @@ void QWaylandWindow::reset(bool sendDestroyEvent) mShellSurface = nullptr; delete mSubSurfaceWindow; mSubSurfaceWindow = nullptr; + + invalidateSurface(); if (mSurface) { emit wlSurfaceDestroyed(); QWriteLocker lock(&mSurfaceLock); @@ -255,10 +264,7 @@ void QWaylandWindow::reset(bool sendDestroyEvent) mFrameCallback = nullptr; } - int timerId = mFrameCallbackTimerId.fetchAndStoreOrdered(-1); - if (timerId != -1) { - killTimer(timerId); - } + mFrameCallbackElapsedTimer.invalidate(); mWaitingForFrameCallback = false; mFrameCallbackTimedOut = false; @@ -600,15 +606,11 @@ const wl_callback_listener QWaylandWindow::callbackListener = { void QWaylandWindow::handleFrameCallback() { - // Stop the timer and stop waiting immediately - int timerId = mFrameCallbackTimerId.fetchAndStoreOrdered(-1); mWaitingForFrameCallback = false; + mFrameCallbackElapsedTimer.invalidate(); // The rest can wait until we can run it on the correct thread - auto doHandleExpose = [this, timerId]() { - if (timerId != -1) - killTimer(timerId); - + auto doHandleExpose = [this]() { bool wasExposed = isExposed(); mFrameCallbackTimedOut = false; if (!wasExposed && isExposed()) // Did setting mFrameCallbackTimedOut make the window exposed? @@ -643,13 +645,6 @@ bool QWaylandWindow::waitForFrameSync(int timeout) sendExposeEvent(QRect()); } - // Stop current frame timer if any, can't use killTimer directly, because we might be on a diffent thread - // Ordered semantics is needed to avoid stopping the timer twice and not miss it when it's - // started by other writes - int fcbId = mFrameCallbackTimerId.fetchAndStoreOrdered(-1); - if (fcbId != -1) - QMetaObject::invokeMethod(this, [this, fcbId] { killTimer(fcbId); }, Qt::QueuedConnection); - return !mWaitingForFrameCallback; } @@ -1105,8 +1100,16 @@ QVariant QWaylandWindow::property(const QString &name, const QVariant &defaultVa void QWaylandWindow::timerEvent(QTimerEvent *event) { - if (mFrameCallbackTimerId.testAndSetOrdered(event->timerId(), -1)) { - killTimer(event->timerId()); + if (event->timerId() != mFrameCallbackCheckIntervalTimerId) + return; + + bool callbackTimerExpired = mFrameCallbackElapsedTimer.hasExpired(mFrameCallbackTimeout); + if (!mFrameCallbackElapsedTimer.isValid() || callbackTimerExpired ) { + killTimer(mFrameCallbackCheckIntervalTimerId); + mFrameCallbackCheckIntervalTimerId = -1; + } + if (mFrameCallbackElapsedTimer.isValid() && callbackTimerExpired) { + mFrameCallbackElapsedTimer.invalidate(); qCDebug(lcWaylandBackingstore) << "Didn't receive frame callback in time, window should now be inexposed"; mFrameCallbackTimedOut = true; mWaitingForUpdate = false; @@ -1160,16 +1163,16 @@ void QWaylandWindow::handleUpdate() mWaitingForFrameCallback = true; mWaitingForUpdate = false; - // Stop current frame timer if any, can't use killTimer directly, see comment above. - int fcbId = mFrameCallbackTimerId.fetchAndStoreOrdered(-1); - if (fcbId != -1) - QMetaObject::invokeMethod(this, [this, fcbId] { killTimer(fcbId); }, Qt::QueuedConnection); - // Start a timer for handling the case when the compositor stops sending frame callbacks. - QMetaObject::invokeMethod(this, [this] { // Again; can't do it directly - if (mWaitingForFrameCallback) - mFrameCallbackTimerId = startTimer(100); - }, Qt::QueuedConnection); + if (mFrameCallbackTimeout > 0) { + QMetaObject::invokeMethod(this, [this] { + if (mWaitingForFrameCallback) { + if (mFrameCallbackCheckIntervalTimerId < 0) + mFrameCallbackCheckIntervalTimerId = startTimer(mFrameCallbackTimeout); + mFrameCallbackElapsedTimer.start(); + } + }, Qt::QueuedConnection); + } } void QWaylandWindow::deliverUpdateRequest() diff --git a/src/client/qwaylandwindow_p.h b/src/client/qwaylandwindow_p.h index 352df89d..89d6272d 100644 --- a/src/client/qwaylandwindow_p.h +++ b/src/client/qwaylandwindow_p.h @@ -58,6 +58,7 @@ #include <QtGui/QIcon> #include <QtCore/QVariant> #include <QtCore/QLoggingCategory> +#include <QtCore/QElapsedTimer> #include <qpa/qplatformwindow.h> @@ -225,7 +226,8 @@ protected: WId mWindowId; bool mWaitingForFrameCallback = false; bool mFrameCallbackTimedOut = false; // Whether the frame callback has timed out - QAtomicInt mFrameCallbackTimerId = -1; // Started on commit, reset on frame callback + int mFrameCallbackCheckIntervalTimerId = -1; + QElapsedTimer mFrameCallbackElapsedTimer; struct ::wl_callback *mFrameCallback = nullptr; struct ::wl_event_queue *mFrameQueue = nullptr; QWaitCondition mFrameSyncWait; @@ -238,6 +240,7 @@ protected: bool mCanResize = true; bool mResizeDirty = false; bool mResizeAfterSwap; + int mFrameCallbackTimeout = 100; QVariantMap m_properties; bool mSentInitialResize = false; diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp b/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp index e8d43fad..7889f575 100644 --- a/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp +++ b/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp @@ -162,13 +162,6 @@ QSurfaceFormat QWaylandEglWindow::format() const return m_format; } -void QWaylandEglWindow::setVisible(bool visible) -{ - QWaylandWindow::setVisible(visible); - if (!visible) - invalidateSurface(); -} - void QWaylandEglWindow::invalidateSurface() { if (m_eglSurface) { diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.h b/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.h index 878532af..5b1f4d56 100644 --- a/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.h +++ b/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.h @@ -75,7 +75,6 @@ public: void bindContentFBO(); void invalidateSurface() override; - void setVisible(bool visible) override; private: QWaylandEglClientBufferIntegration *m_clientBufferIntegration = nullptr; |