mirror of
https://git.savannah.gnu.org/git/guix.git
synced 2026-04-06 21:20:33 +02:00
The KDE Qt5 Patch Collection (kde/5.15 branch) maintains backported fixes
for Qt 5.15 that were not backported by Qt upstream. This includes a fix
for QTBUG-103391: a fatal Wayland protocol error when a QDialog's
maximumWidth is less than the minimum width required by its contents.
Qt's Wayland backend sent set_min_size and set_max_size without ensuring
max >= min, violating the xdg-shell protocol.
* gnu/packages/patches/qtwayland-5.15.18-0001-client-announce-an-output-after-receiving-more-compl.patch,
gnu/packages/patches/qtwayland-5.15.18-0002-fix-issue-with-repeated-window-size-changes.patch,
gnu/packages/patches/qtwayland-5.15.18-0003-client-connect-drags-being-accepted-to-updating-the-.patch,
gnu/packages/patches/qtwayland-5.15.18-0004-client-disconnect-registry-listener-on-destruction.patch,
gnu/packages/patches/qtwayland-5.15.18-0005-client-set-xdgshell-size-hints-before-the-first-comm.patch,
gnu/packages/patches/qtwayland-5.15.18-0006-fix-build.patch,
gnu/packages/patches/qtwayland-5.15.18-0007-fix-remove-listener.patch,
gnu/packages/patches/qtwayland-5.15.18-0008-hook-up-querykeyboardmodifers.patch,
gnu/packages/patches/qtwayland-5.15.18-0009-correctly-detect-if-image-format-is-supported-by-qim.patch,
gnu/packages/patches/qtwayland-5.15.18-0010-client-don-t-always-recreate-frame-callbacks.patch,
gnu/packages/patches/qtwayland-5.15.18-0011-client-always-destroy-frame-callback-in-the-actual-c.patch,
gnu/packages/patches/qtwayland-5.15.18-0012-wayland-client-use-wl_keyboard-to-determine-active-s.patch,
gnu/packages/patches/qtwayland-5.15.18-0013-client-do-not-empty-clipboard-when-a-new-popup-windo.patch,
gnu/packages/patches/qtwayland-5.15.18-0014-client-implement-datadevicev3.patch,
gnu/packages/patches/qtwayland-5.15.18-0015-client-delay-deletion-of-qdrag-object-until-after-we.patch,
gnu/packages/patches/qtwayland-5.15.18-0016-client-avoid-processing-of-events-when-showing-windo.patch,
gnu/packages/patches/qtwayland-5.15.18-0017-handle-registry_global-out-of-constructor.patch,
gnu/packages/patches/qtwayland-5.15.18-0018-connect-flushrequest-after-forceroundtrip.patch,
gnu/packages/patches/qtwayland-5.15.18-0019-move-the-wayland-socket-polling-to-a-separate-event-.patch,
gnu/packages/patches/qtwayland-5.15.18-0020-client-remove-mwaitingforupdatedelivery.patch,
gnu/packages/patches/qtwayland-5.15.18-0021-client-simplify-round-trip-behavior.patch,
gnu/packages/patches/qtwayland-5.15.18-0022-client-fix-opaque-region-setter.patch,
gnu/packages/patches/qtwayland-5.15.18-0023-use-proper-dependencies-in-compile-tests.patch,
gnu/packages/patches/qtwayland-5.15.18-0024-revert-client-remove-mwaitingforupdatedelivery.patch,
gnu/packages/patches/qtwayland-5.15.18-0025-fix-race-condition-on-mwaitingforupdatedelivery.patch,
gnu/packages/patches/qtwayland-5.15.18-0026-use-poll-2-when-reading-from-clipboard.patch,
gnu/packages/patches/qtwayland-5.15.18-0027-reduce-memory-leakage.patch,
gnu/packages/patches/qtwayland-5.15.18-0028-only-close-popup-in-the-the-hierchary.patch,
gnu/packages/patches/qtwayland-5.15.18-0029-check-pointer-for-null-before-use-in-assert.patch,
gnu/packages/patches/qtwayland-5.15.18-0030-use-wl_surface.damage_buffer-on-the-client-side.patch,
gnu/packages/patches/qtwayland-5.15.18-0031-client-clear-focus-on-touch-cancel.patch,
gnu/packages/patches/qtwayland-5.15.18-0032-guard-mresizedirty-by-the-correctmutex.patch,
gnu/packages/patches/qtwayland-5.15.18-0033-fix-compile-tests.patch,
gnu/packages/patches/qtwayland-5.15.18-0034-call-finishdrag-in-qwaylanddatadevice-dragsourcecanc.patch,
gnu/packages/patches/qtwayland-5.15.18-0035-hold-surface-read-lock-throughout-qwaylandeglwindow-.patch,
gnu/packages/patches/qtwayland-5.15.18-0036-keep-toplevel-windows-in-the-top-left-corner-of-the-.patch,
gnu/packages/patches/qtwayland-5.15.18-0037-client-add-f_seal_shrink-seal-to-shm-backing-file.patch,
gnu/packages/patches/qtwayland-5.15.18-0038-client-call-wl_output_release-upon-qwaylandscreen-de.patch,
gnu/packages/patches/qtwayland-5.15.18-0039-client-bump-wl_output-version.patch,
gnu/packages/patches/qtwayland-5.15.18-0040-fix-frame-sync-related-to-unprotected-multithread-ac.patch,
gnu/packages/patches/qtwayland-5.15.18-0041-client-handle-zwp_primary_selection_device_manager_v.patch,
gnu/packages/patches/qtwayland-5.15.18-0042-fixes-the-build-on-centos.patch,
gnu/packages/patches/qtwayland-5.15.18-0043-client-avoid-protocol-error-with-invalid-min-max-siz.patch,
gnu/packages/patches/qtwayland-5.15.18-0044-client-fix-handling-of-qt-blankcursor.patch,
gnu/packages/patches/qtwayland-5.15.18-0045-client-force-a-roundtrip-when-an-xdgoutput-is-not-re.patch,
gnu/packages/patches/qtwayland-5.15.18-0046-destroy-frame-queue-before-display.patch,
gnu/packages/patches/qtwayland-5.15.18-0047-client-fix-crash-on-dnd-updates-after-client-facing-.patch,
gnu/packages/patches/qtwayland-5.15.18-0048-convert-cursor-bitmap-to-supported-format.patch,
gnu/packages/patches/qtwayland-5.15.18-0049-replace-scale-with-devicepixelratio-for-non-integer-.patch,
gnu/packages/patches/qtwayland-5.15.18-0050-client-fix-buffer-damage.patch,
gnu/packages/patches/qtwayland-5.15.18-0051-client-commit-the-initial-surface-state-explicitly.patch,
gnu/packages/patches/qtwayland-5.15.18-0052-tests-fix-tst_xdgshell-minmaxsize.patch,
gnu/packages/patches/qtwayland-5.15.18-0053-client-remove-some-surface-commits.patch,
gnu/packages/patches/qtwayland-5.15.18-0054-client-avoid-locking-resizing-in-qwaylandshmbackings.patch,
gnu/packages/patches/qtwayland-5.15.18-0055-bradient-use-qwaylandwindow-actual-window-title.patch: New files.
* gnu/packages/patches/qtwayland-dont-recreate-callbacks.patch,
gnu/packages/patches/qtwayland-cleanup-callbacks.patch: Delete files,
superseded by KDE patches 0010 and 0011.
* gnu/local.mk (dist_patch_DATA): Register new patches, remove old ones.
* gnu/packages/qt.scm (qtwayland-5)[source]: Replace old patches with KDE
Qt5 Patch Collection.
[arguments]<:phases>{disable-failing-tests}: Skip tst_xdgshell::minMaxSize()
test; patch 0053 removed the synchronous surface commit from
propagateSizeHints(), so the test's immediate check of the committed value
no longer works.
Fixes: guix/guix#6397
Change-Id: Ia9e890c2943c47287f73654d1654e06ba775b6f6
170 lines
7.4 KiB
Diff
170 lines
7.4 KiB
Diff
From 1ba45e04b989ef9b22742ccd3a4a5fc3c6a4018b Mon Sep 17 00:00:00 2001
|
|
From: Jungi Byun <jungi.byun@lge.com>
|
|
Date: Wed, 27 Jan 2021 08:24:23 +0900
|
|
Subject: [PATCH 49/55] Replace scale with devicePixelRatio for non-integer
|
|
scaling
|
|
|
|
The 'scale' event from wayland cannot support non-integer scaling
|
|
which was originally supported in Qt.
|
|
|
|
As default, devicePixelRatio follows the 'scale' so that the high DPI
|
|
still works as the mechanism in Wayland. But if non-integer scaling
|
|
factor such as 150% is needed, it can be supported to override the
|
|
devicePixelRatio.
|
|
|
|
Change-Id: I63a04db27bd521264b6d0904e1ddd05a572dc970
|
|
Reviewed-by: Elvis Lee <kwangwoong.lee@lge.com>
|
|
Reviewed-by: Jungi Byun <jungi.byun@lge.com>
|
|
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
|
|
(cherry picked from commit cf98abbc6ae9ba9373803ffe193f839324e0c80b)
|
|
---
|
|
src/client/qwaylandabstractdecoration.cpp | 2 +-
|
|
src/client/qwaylandshmbackingstore.cpp | 6 +++---
|
|
src/client/qwaylandshmbackingstore_p.h | 2 +-
|
|
src/client/qwaylandwindow.cpp | 16 ++++++++--------
|
|
src/client/qwaylandwindow_p.h | 2 +-
|
|
.../client/wayland-egl/qwaylandglcontext.cpp | 2 +-
|
|
6 files changed, 15 insertions(+), 15 deletions(-)
|
|
|
|
diff --git a/src/client/qwaylandabstractdecoration.cpp b/src/client/qwaylandabstractdecoration.cpp
|
|
index b628930d..d15a7f9f 100644
|
|
--- a/src/client/qwaylandabstractdecoration.cpp
|
|
+++ b/src/client/qwaylandabstractdecoration.cpp
|
|
@@ -122,7 +122,7 @@ const QImage &QWaylandAbstractDecoration::contentImage()
|
|
if (d->m_isDirty) {
|
|
// Update the decoration backingstore
|
|
|
|
- const int bufferScale = waylandWindow()->scale();
|
|
+ const qreal bufferScale = waylandWindow()->scale();
|
|
const QSize imageSize = waylandWindow()->surfaceSize() * bufferScale;
|
|
d->m_decorationContentImage = QImage(imageSize, QImage::Format_ARGB32_Premultiplied);
|
|
// Only scale by buffer scale, not QT_SCALE_FACTOR etc.
|
|
diff --git a/src/client/qwaylandshmbackingstore.cpp b/src/client/qwaylandshmbackingstore.cpp
|
|
index 41cffdf7..90e37e95 100644
|
|
--- a/src/client/qwaylandshmbackingstore.cpp
|
|
+++ b/src/client/qwaylandshmbackingstore.cpp
|
|
@@ -72,7 +72,7 @@ QT_BEGIN_NAMESPACE
|
|
namespace QtWaylandClient {
|
|
|
|
QWaylandShmBuffer::QWaylandShmBuffer(QWaylandDisplay *display,
|
|
- const QSize &size, QImage::Format format, int scale)
|
|
+ const QSize &size, QImage::Format format, qreal scale)
|
|
{
|
|
int stride = size.width() * 4;
|
|
int alloc = stride * size.height();
|
|
@@ -114,7 +114,7 @@ QWaylandShmBuffer::QWaylandShmBuffer(QWaylandDisplay *display,
|
|
QWaylandShm* shm = display->shm();
|
|
wl_shm_format wl_format = shm->formatFrom(format);
|
|
mImage = QImage(data, size.width(), size.height(), stride, format);
|
|
- mImage.setDevicePixelRatio(qreal(scale));
|
|
+ mImage.setDevicePixelRatio(scale);
|
|
|
|
mShmPool = wl_shm_create_pool(shm->object(), fd, alloc);
|
|
init(wl_shm_pool_create_buffer(mShmPool,0, size.width(), size.height(),
|
|
@@ -277,7 +277,7 @@ QWaylandShmBuffer *QWaylandShmBackingStore::getBuffer(const QSize &size)
|
|
void QWaylandShmBackingStore::resize(const QSize &size)
|
|
{
|
|
QMargins margins = windowDecorationMargins();
|
|
- int scale = waylandWindow()->scale();
|
|
+ qreal scale = waylandWindow()->scale();
|
|
QSize sizeWithMargins = (size + QSize(margins.left()+margins.right(),margins.top()+margins.bottom())) * scale;
|
|
|
|
// We look for a free buffer to draw into. If the buffer is not the last buffer we used,
|
|
diff --git a/src/client/qwaylandshmbackingstore_p.h b/src/client/qwaylandshmbackingstore_p.h
|
|
index e01632da..f3fae438 100644
|
|
--- a/src/client/qwaylandshmbackingstore_p.h
|
|
+++ b/src/client/qwaylandshmbackingstore_p.h
|
|
@@ -71,7 +71,7 @@ class QWaylandWindow;
|
|
class Q_WAYLAND_CLIENT_EXPORT QWaylandShmBuffer : public QWaylandBuffer {
|
|
public:
|
|
QWaylandShmBuffer(QWaylandDisplay *display,
|
|
- const QSize &size, QImage::Format format, int scale = 1);
|
|
+ const QSize &size, QImage::Format format, qreal scale = 1);
|
|
~QWaylandShmBuffer() override;
|
|
QSize size() const override { return mImage.size(); }
|
|
int scale() const override { return int(mImage.devicePixelRatio()); }
|
|
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp
|
|
index 5280a9f7..38b10269 100644
|
|
--- a/src/client/qwaylandwindow.cpp
|
|
+++ b/src/client/qwaylandwindow.cpp
|
|
@@ -185,7 +185,7 @@ void QWaylandWindow::initWindow()
|
|
// 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.
|
|
if (mDisplay->compositorVersion() >= 3)
|
|
- mSurface->set_buffer_scale(scale());
|
|
+ mSurface->set_buffer_scale(mScale);
|
|
|
|
if (QScreen *s = window()->screen())
|
|
setOrientationMask(s->orientationUpdateMask());
|
|
@@ -572,9 +572,9 @@ void QWaylandWindow::damage(const QRect &rect)
|
|
if (mSurface == nullptr)
|
|
return;
|
|
|
|
- const int s = scale();
|
|
+ const qreal s = scale();
|
|
if (mDisplay->compositorVersion() >= 4)
|
|
- mSurface->damage_buffer(s * rect.x(), s * rect.y(), s * rect.width(), s * rect.height());
|
|
+ mSurface->damage_buffer(qFloor(s * rect.x()), qFloor(s * rect.y()), qCeil(s * rect.width()), qCeil(s * rect.height()));
|
|
else
|
|
mSurface->damage(rect.x(), rect.y(), rect.width(), rect.height());
|
|
}
|
|
@@ -613,9 +613,9 @@ void QWaylandWindow::commit(QWaylandBuffer *buffer, const QRegion &damage)
|
|
|
|
attachOffset(buffer);
|
|
if (mDisplay->compositorVersion() >= 4) {
|
|
- const int s = scale();
|
|
+ const qreal s = scale();
|
|
for (const QRect &rect: damage)
|
|
- mSurface->damage_buffer(s * rect.x(), s * rect.y(), s * rect.width(), s * rect.height());
|
|
+ mSurface->damage_buffer(qFloor(s * rect.x()), qFloor(s * rect.y()), qCeil(s * rect.width()), qCeil(s * rect.height()));
|
|
} else {
|
|
for (const QRect &rect: damage)
|
|
mSurface->damage(rect.x(), rect.y(), rect.width(), rect.height());
|
|
@@ -1106,14 +1106,14 @@ bool QWaylandWindow::isActive() const
|
|
return mDisplay->isWindowActivated(this);
|
|
}
|
|
|
|
-int QWaylandWindow::scale() const
|
|
+qreal QWaylandWindow::scale() const
|
|
{
|
|
- return mScale;
|
|
+ return devicePixelRatio();
|
|
}
|
|
|
|
qreal QWaylandWindow::devicePixelRatio() const
|
|
{
|
|
- return mScale;
|
|
+ return qreal(mScale);
|
|
}
|
|
|
|
bool QWaylandWindow::setMouseGrabEnabled(bool grab)
|
|
diff --git a/src/client/qwaylandwindow_p.h b/src/client/qwaylandwindow_p.h
|
|
index 2f219d8c..741f9e5c 100644
|
|
--- a/src/client/qwaylandwindow_p.h
|
|
+++ b/src/client/qwaylandwindow_p.h
|
|
@@ -158,7 +158,7 @@ public:
|
|
|
|
void setMask(const QRegion ®ion) override;
|
|
|
|
- int scale() const;
|
|
+ qreal scale() const;
|
|
qreal devicePixelRatio() const override;
|
|
|
|
void requestActivateWindow() override;
|
|
diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp
|
|
index c1f45fa6..bbc63444 100644
|
|
--- a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp
|
|
+++ b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp
|
|
@@ -195,7 +195,7 @@ public:
|
|
QOpenGLTextureCache *cache = QOpenGLTextureCache::cacheForContext(m_context->context());
|
|
|
|
QSize surfaceSize = window->surfaceSize();
|
|
- int scale = window->scale() ;
|
|
+ qreal scale = window->scale() ;
|
|
glViewport(0, 0, surfaceSize.width() * scale, surfaceSize.height() * scale);
|
|
|
|
//Draw Decoration
|
|
--
|
|
2.52.0
|
|
|