parent
f217e468e9
commit
03d7577cc0
@ -1 +1 @@
|
|||||||
SOURCES/qtwayland-everywhere-opensource-src-5.15.9.tar.xz
|
SOURCES/qtwayland-everywhere-opensource-src-5.15.15.tar.xz
|
||||||
|
@ -1 +1 @@
|
|||||||
dcaac92b52d681c9d13330e78fcd745005269fdc SOURCES/qtwayland-everywhere-opensource-src-5.15.9.tar.xz
|
171583a180bd291a0f21021dfc721b96e1d5a9f1 SOURCES/qtwayland-everywhere-opensource-src-5.15.15.tar.xz
|
||||||
|
@ -1,32 +0,0 @@
|
|||||||
From d9b04ba05ed479b577579e6a34d97fb906791f69 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Sam James <sam@gentoo.org>
|
|
||||||
Date: Sat, 18 Jun 2022 17:11:11 +0100
|
|
||||||
Subject: [PATCH 28/55] Fix build with libcxx (missing array include)
|
|
||||||
|
|
||||||
Bug: https://bugs.gentoo.org/833488
|
|
||||||
|
|
||||||
Task-number: QTBUG-104435
|
|
||||||
Change-Id: I06384761a5560b81b675e6c4ae498bb93dcb4f4f
|
|
||||||
Pick-to: 5.15 6.2 6.3 6.4
|
|
||||||
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
|
|
||||||
(cherry picked from commit 5065013b0c2346b5918a2681ae2e58046140e8a7)
|
|
||||||
---
|
|
||||||
.../compositor/linux-dmabuf-unstable-v1/linuxdmabuf.h | 2 ++
|
|
||||||
1 file changed, 2 insertions(+)
|
|
||||||
|
|
||||||
diff --git a/src/hardwareintegration/compositor/linux-dmabuf-unstable-v1/linuxdmabuf.h b/src/hardwareintegration/compositor/linux-dmabuf-unstable-v1/linuxdmabuf.h
|
|
||||||
index 56a710c3..c6a8b6c6 100644
|
|
||||||
--- a/src/hardwareintegration/compositor/linux-dmabuf-unstable-v1/linuxdmabuf.h
|
|
||||||
+++ b/src/hardwareintegration/compositor/linux-dmabuf-unstable-v1/linuxdmabuf.h
|
|
||||||
@@ -41,6 +41,8 @@
|
|
||||||
#include <QtCore/QTextStream>
|
|
||||||
#include <QtGui/QOpenGLTexture>
|
|
||||||
|
|
||||||
+#include <array>
|
|
||||||
+
|
|
||||||
#include <EGL/egl.h>
|
|
||||||
#include <EGL/eglext.h>
|
|
||||||
|
|
||||||
--
|
|
||||||
2.40.0
|
|
||||||
|
|
@ -1,28 +0,0 @@
|
|||||||
From 08ce7a21017e1f9553cd0f4af1316e38709d5553 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Ville Voutilainen <ville.voutilainen@qt.io>
|
|
||||||
Date: Mon, 18 Jan 2021 12:31:31 +0200
|
|
||||||
Subject: [PATCH 30/55] Build fixes for GCC 11
|
|
||||||
|
|
||||||
Task-number: QTBUG-89977
|
|
||||||
Change-Id: I7e3d0964087865e8062f539f851a61f3df017dae
|
|
||||||
Reviewed-by: David Edmundson <davidedmundson@kde.org>
|
|
||||||
(cherry picked from commit 1aa6ec2c778504d96543f6cdc2b9199a7b066fc1)
|
|
||||||
---
|
|
||||||
tests/auto/client/shared/corecompositor.cpp | 1 +
|
|
||||||
1 file changed, 1 insertion(+)
|
|
||||||
|
|
||||||
diff --git a/tests/auto/client/shared/corecompositor.cpp b/tests/auto/client/shared/corecompositor.cpp
|
|
||||||
index 5c6c83ba..fa9b7662 100644
|
|
||||||
--- a/tests/auto/client/shared/corecompositor.cpp
|
|
||||||
+++ b/tests/auto/client/shared/corecompositor.cpp
|
|
||||||
@@ -27,6 +27,7 @@
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#include "corecompositor.h"
|
|
||||||
+#include <thread>
|
|
||||||
|
|
||||||
namespace MockCompositor {
|
|
||||||
|
|
||||||
--
|
|
||||||
2.40.0
|
|
||||||
|
|
@ -1,72 +0,0 @@
|
|||||||
From 1ff4219d8c58f8356d9d12824948013cdfde6ac5 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Liang Qi <liang.qi@qt.io>
|
|
||||||
Date: Fri, 11 Mar 2022 09:17:25 +0100
|
|
||||||
Subject: [PATCH 35/55] client: Synthesize enter/leave event for popup in
|
|
||||||
xdg-shell
|
|
||||||
MIME-Version: 1.0
|
|
||||||
Content-Type: text/plain; charset=UTF-8
|
|
||||||
Content-Transfer-Encoding: 8bit
|
|
||||||
|
|
||||||
Fixes: QTBUG-100148
|
|
||||||
Pick-to: 6.3 6.2 5.15
|
|
||||||
Change-Id: I45e3156d7942cff9968674c0b253d15be7235921
|
|
||||||
Reviewed-by: Tang Haixiang <tanghaixiang@uniontech.com>
|
|
||||||
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
|
|
||||||
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
|
|
||||||
(cherry picked from commit 73d35d3117722cef8e94f0d2036c56ad0a5ddae9)
|
|
||||||
|
|
||||||
* asturmlechner 2022-09-08: Resolve conflict with dev branch commits
|
|
||||||
b6a3a938abd4a7fdb7ea96a38485b53f394fba17 and
|
|
||||||
f8e3257e9b1e22d52e9c221c62b8d9b6dd1151a3
|
|
||||||
---
|
|
||||||
.../xdg-shell/qwaylandxdgshell.cpp | 27 +++++++++++++++++++
|
|
||||||
1 file changed, 27 insertions(+)
|
|
||||||
|
|
||||||
diff --git a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp
|
|
||||||
index 962001b3..ead99989 100644
|
|
||||||
--- a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp
|
|
||||||
+++ b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp
|
|
||||||
@@ -221,6 +221,16 @@ QWaylandXdgSurface::Popup::~Popup()
|
|
||||||
auto *shell = m_xdgSurface->m_shell;
|
|
||||||
Q_ASSERT(shell->m_topmostGrabbingPopup == this);
|
|
||||||
shell->m_topmostGrabbingPopup = m_parentXdgSurface ? m_parentXdgSurface->m_popup : nullptr;
|
|
||||||
+ m_grabbing = false;
|
|
||||||
+
|
|
||||||
+ // Synthesize Qt enter/leave events for popup
|
|
||||||
+ QWindow *leave = nullptr;
|
|
||||||
+ if (m_xdgSurface && m_xdgSurface->window())
|
|
||||||
+ leave = m_xdgSurface->window()->window();
|
|
||||||
+ QWindowSystemInterface::handleLeaveEvent(leave);
|
|
||||||
+
|
|
||||||
+ if (QWindow *enter = QGuiApplication::topLevelAt(QCursor::pos()))
|
|
||||||
+ QWindowSystemInterface::handleEnterEvent(enter, enter->mapFromGlobal(QCursor::pos()), QCursor::pos());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -442,6 +452,23 @@ void QWaylandXdgSurface::setGrabPopup(QWaylandWindow *parent, QWaylandInputDevic
|
|
||||||
}
|
|
||||||
setPopup(parent);
|
|
||||||
m_popup->grab(device, serial);
|
|
||||||
+
|
|
||||||
+ // Synthesize Qt enter/leave events for popup
|
|
||||||
+ if (!parent)
|
|
||||||
+ return;
|
|
||||||
+ QWindow *current = QGuiApplication::topLevelAt(QCursor::pos());
|
|
||||||
+ QWindow *leave = parent->window();
|
|
||||||
+ if (current != leave)
|
|
||||||
+ return;
|
|
||||||
+
|
|
||||||
+ QWindowSystemInterface::handleLeaveEvent(leave);
|
|
||||||
+
|
|
||||||
+ QWindow *enter = nullptr;
|
|
||||||
+ if (m_popup && m_popup->m_xdgSurface && m_popup->m_xdgSurface->window())
|
|
||||||
+ enter = m_popup->m_xdgSurface->window()->window();
|
|
||||||
+
|
|
||||||
+ if (enter)
|
|
||||||
+ QWindowSystemInterface::handleEnterEvent(enter, enter->mapFromGlobal(QCursor::pos()), QCursor::pos());
|
|
||||||
}
|
|
||||||
|
|
||||||
void QWaylandXdgSurface::xdg_surface_configure(uint32_t serial)
|
|
||||||
--
|
|
||||||
2.40.0
|
|
||||||
|
|
@ -1,40 +0,0 @@
|
|||||||
From 137958eec28cb8209069f9a3a3ab778202773ff6 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Alexandros Frantzis <alexandros.frantzis@collabora.com>
|
|
||||||
Date: Wed, 11 May 2022 17:12:52 +0300
|
|
||||||
Subject: [PATCH 37/55] Use CRLF line delimiter for text/uri-list data
|
|
||||||
|
|
||||||
According to RFC 2483, which describes text/uri-list, the line delimiter
|
|
||||||
must be CRLF (instead of the currently used LF). Some applications
|
|
||||||
strictly expect the CRLF delimiter and fail to properly parse the
|
|
||||||
uri-list otherwise (e.g., WineX11/XWayland).
|
|
||||||
|
|
||||||
https://datatracker.ietf.org/doc/html/rfc2483
|
|
||||||
|
|
||||||
5. The text/uri-list Internet Media Type
|
|
||||||
The format of text/uri-list resources is:
|
|
||||||
3) As for all text/* formats, lines are terminated with a CRLF pair.
|
|
||||||
|
|
||||||
Pick-to: 6.4 6.3 6.2 5.15
|
|
||||||
Change-Id: I7c062224a9060028ab6293fdf172692ade28cca5
|
|
||||||
Reviewed-by: David Edmundson <davidedmundson@kde.org>
|
|
||||||
(cherry picked from commit bd5b0a804b91b9fbd0ce44d5d6765e07d0a50b4f)
|
|
||||||
---
|
|
||||||
src/shared/qwaylandmimehelper.cpp | 2 +-
|
|
||||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/src/shared/qwaylandmimehelper.cpp b/src/shared/qwaylandmimehelper.cpp
|
|
||||||
index 051a91dc..e2fe1928 100644
|
|
||||||
--- a/src/shared/qwaylandmimehelper.cpp
|
|
||||||
+++ b/src/shared/qwaylandmimehelper.cpp
|
|
||||||
@@ -74,7 +74,7 @@ QByteArray QWaylandMimeHelper::getByteArray(QMimeData *mimeData, const QString &
|
|
||||||
QList<QUrl> urls = mimeData->urls();
|
|
||||||
for (int i = 0; i < urls.count(); ++i) {
|
|
||||||
content.append(urls.at(i).toEncoded());
|
|
||||||
- content.append('\n');
|
|
||||||
+ content.append("\r\n");
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
content = mimeData->data(mimeType);
|
|
||||||
--
|
|
||||||
2.40.0
|
|
||||||
|
|
@ -1,43 +0,0 @@
|
|||||||
From 0064749af275016ae3b4b09964d8d31d756d3468 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
|
|
||||||
Date: Mon, 8 Aug 2022 12:14:01 +0200
|
|
||||||
Subject: [PATCH 38/55] Avoid calling requestUpdate from wrong thread
|
|
||||||
|
|
||||||
In certain circumstances, we can get to createDecoration()
|
|
||||||
from the render thread (from QWaylandGLContext::makeCurrent)
|
|
||||||
|
|
||||||
Calling requestUpdate() from this secondary thread would
|
|
||||||
cause an assert, so we queue the call on the appropriate
|
|
||||||
thread instead.
|
|
||||||
|
|
||||||
This amends af7b60ade5c4be81cbc58eb18307c017d5594071.
|
|
||||||
|
|
||||||
Pick-to: 5.15 6.2 6.3 6.3.2 6.4
|
|
||||||
Fixes: QTBUG-105308
|
|
||||||
Change-Id: I4805265f39e24eb1464897532be2025bc3c27728
|
|
||||||
Reviewed-by: Inho Lee <inho.lee@qt.io>
|
|
||||||
(cherry picked from commit a0c0b5b42335808c2222cbf72c1758e955731ed9)
|
|
||||||
---
|
|
||||||
src/client/qwaylandwindow.cpp | 6 +++++-
|
|
||||||
1 file changed, 5 insertions(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp
|
|
||||||
index 117e3383..4ddf9fbe 100644
|
|
||||||
--- a/src/client/qwaylandwindow.cpp
|
|
||||||
+++ b/src/client/qwaylandwindow.cpp
|
|
||||||
@@ -873,7 +873,11 @@ bool QWaylandWindow::createDecoration()
|
|
||||||
// size and are not redrawn, leaving the new buffer empty. As a simple
|
|
||||||
// work-around, we trigger a full extra update whenever the client-side
|
|
||||||
// window decorations are toggled while the window is showing.
|
|
||||||
- window()->requestUpdate();
|
|
||||||
+ // Note: createDecoration() is sometimes called from the render thread
|
|
||||||
+ // of Qt Quick. This is essentially wrong and could potentially cause problems,
|
|
||||||
+ // but until the underlying issue has been fixed, we have to use invokeMethod()
|
|
||||||
+ // here to avoid asserts.
|
|
||||||
+ QMetaObject::invokeMethod(window(), &QWindow::requestUpdate);
|
|
||||||
}
|
|
||||||
|
|
||||||
return mWindowDecoration;
|
|
||||||
--
|
|
||||||
2.40.0
|
|
||||||
|
|
@ -1,109 +0,0 @@
|
|||||||
From 1012f1d4b5753ad63da3cca1226fb034e297ae6d Mon Sep 17 00:00:00 2001
|
|
||||||
From: Vlad Zahorodnii <vlad.zahorodnii@kde.org>
|
|
||||||
Date: Tue, 8 Nov 2022 16:10:18 +0200
|
|
||||||
Subject: [PATCH 41/55] Client: Ensure that wl_surface lives as long as qtquick
|
|
||||||
render thread needs it
|
|
||||||
|
|
||||||
wl_surface can be destroyed while qtquick render thread still uses it.
|
|
||||||
That can end up in eglSwapBuffers() using defunct wl_surface, which will
|
|
||||||
eventually lead to a crash due to the compositor posting an error.
|
|
||||||
|
|
||||||
This is partially cherry-pick of dff579147b07cd15888a47c303e36684e9930f9f
|
|
||||||
|
|
||||||
Change-Id: I044f40dd64e6672027a833379b57ccd9973d8305
|
|
||||||
---
|
|
||||||
src/client/qwaylandwindow.cpp | 13 ++++++++++++-
|
|
||||||
src/client/qwaylandwindow_p.h | 3 +++
|
|
||||||
.../client/wayland-egl/qwaylandglcontext.cpp | 6 +++++-
|
|
||||||
3 files changed, 20 insertions(+), 2 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp
|
|
||||||
index 4ddf9fbe..1f2d56b5 100644
|
|
||||||
--- a/src/client/qwaylandwindow.cpp
|
|
||||||
+++ b/src/client/qwaylandwindow.cpp
|
|
||||||
@@ -76,6 +76,7 @@ QWaylandWindow *QWaylandWindow::mMouseGrab = nullptr;
|
|
||||||
QWaylandWindow::QWaylandWindow(QWindow *window, QWaylandDisplay *display)
|
|
||||||
: QPlatformWindow(window)
|
|
||||||
, mDisplay(display)
|
|
||||||
+ , mSurfaceLock(QReadWriteLock::Recursive)
|
|
||||||
, mResizeAfterSwap(qEnvironmentVariableIsSet("QT_WAYLAND_RESIZE_AFTER_SWAP"))
|
|
||||||
{
|
|
||||||
{
|
|
||||||
@@ -237,6 +238,16 @@ bool QWaylandWindow::shouldCreateSubSurface() const
|
|
||||||
return QPlatformWindow::parent() != nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
+void QWaylandWindow::beginFrame()
|
|
||||||
+{
|
|
||||||
+ mSurfaceLock.lockForRead();
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+void QWaylandWindow::endFrame()
|
|
||||||
+{
|
|
||||||
+ mSurfaceLock.unlock();
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
void QWaylandWindow::reset()
|
|
||||||
{
|
|
||||||
closeChildPopups();
|
|
||||||
@@ -245,10 +256,10 @@ void QWaylandWindow::reset()
|
|
||||||
delete mSubSurfaceWindow;
|
|
||||||
mSubSurfaceWindow = nullptr;
|
|
||||||
|
|
||||||
- invalidateSurface();
|
|
||||||
if (mSurface) {
|
|
||||||
emit wlSurfaceDestroyed();
|
|
||||||
QWriteLocker lock(&mSurfaceLock);
|
|
||||||
+ invalidateSurface();
|
|
||||||
mSurface.reset();
|
|
||||||
}
|
|
||||||
|
|
||||||
diff --git a/src/client/qwaylandwindow_p.h b/src/client/qwaylandwindow_p.h
|
|
||||||
index ea3d1995..e18609d9 100644
|
|
||||||
--- a/src/client/qwaylandwindow_p.h
|
|
||||||
+++ b/src/client/qwaylandwindow_p.h
|
|
||||||
@@ -207,6 +207,9 @@ public:
|
|
||||||
void handleUpdate();
|
|
||||||
void deliverUpdateRequest() override;
|
|
||||||
|
|
||||||
+ void beginFrame();
|
|
||||||
+ void endFrame();
|
|
||||||
+
|
|
||||||
void addChildPopup(QWaylandWindow* child);
|
|
||||||
void removeChildPopup(QWaylandWindow* child);
|
|
||||||
void closeChildPopups();
|
|
||||||
diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp
|
|
||||||
index c1f45fa6..5d6fb2bf 100644
|
|
||||||
--- a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp
|
|
||||||
+++ b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp
|
|
||||||
@@ -432,8 +432,10 @@ bool QWaylandGLContext::makeCurrent(QPlatformSurface *surface)
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
- if (window->isExposed())
|
|
||||||
+ if (window->isExposed()) {
|
|
||||||
+ window->beginFrame();
|
|
||||||
window->setCanResize(false);
|
|
||||||
+ }
|
|
||||||
if (m_decorationsContext != EGL_NO_CONTEXT && !window->decoration())
|
|
||||||
window->createDecoration();
|
|
||||||
|
|
||||||
@@ -449,6 +451,7 @@ bool QWaylandGLContext::makeCurrent(QPlatformSurface *surface)
|
|
||||||
if (!eglMakeCurrent(m_eglDisplay, eglSurface, eglSurface, m_context)) {
|
|
||||||
qWarning("QWaylandGLContext::makeCurrent: eglError: %x, this: %p \n", eglGetError(), this);
|
|
||||||
window->setCanResize(true);
|
|
||||||
+ window->endFrame();
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -502,6 +505,7 @@ void QWaylandGLContext::swapBuffers(QPlatformSurface *surface)
|
|
||||||
eglSwapBuffers(m_eglDisplay, eglSurface);
|
|
||||||
|
|
||||||
window->setCanResize(true);
|
|
||||||
+ window->endFrame();
|
|
||||||
}
|
|
||||||
|
|
||||||
GLuint QWaylandGLContext::defaultFramebufferObject(QPlatformSurface *surface) const
|
|
||||||
--
|
|
||||||
2.40.0
|
|
||||||
|
|
@ -1,103 +0,0 @@
|
|||||||
From 3813da4b6d88320b42a7d91ae100e1567113ee72 Mon Sep 17 00:00:00 2001
|
|
||||||
From: David Edmundson <kde@davidedmundson.co.uk>
|
|
||||||
Date: Mon, 14 Nov 2022 10:43:25 +0000
|
|
||||||
Subject: [PATCH 43/55] Revert "Client: Ensure that wl_surface lives as long as
|
|
||||||
qtquick render thread needs it"
|
|
||||||
|
|
||||||
This reverts commit 81a7702a87f386a60a0ac8c902e203daae044d81
|
|
||||||
---
|
|
||||||
src/client/qwaylandwindow.cpp | 13 +------------
|
|
||||||
src/client/qwaylandwindow_p.h | 3 ---
|
|
||||||
.../client/wayland-egl/qwaylandglcontext.cpp | 6 +-----
|
|
||||||
3 files changed, 2 insertions(+), 20 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp
|
|
||||||
index d3459168..f322a8d6 100644
|
|
||||||
--- a/src/client/qwaylandwindow.cpp
|
|
||||||
+++ b/src/client/qwaylandwindow.cpp
|
|
||||||
@@ -76,7 +76,6 @@ QWaylandWindow *QWaylandWindow::mMouseGrab = nullptr;
|
|
||||||
QWaylandWindow::QWaylandWindow(QWindow *window, QWaylandDisplay *display)
|
|
||||||
: QPlatformWindow(window)
|
|
||||||
, mDisplay(display)
|
|
||||||
- , mSurfaceLock(QReadWriteLock::Recursive)
|
|
||||||
, mResizeAfterSwap(qEnvironmentVariableIsSet("QT_WAYLAND_RESIZE_AFTER_SWAP"))
|
|
||||||
{
|
|
||||||
{
|
|
||||||
@@ -238,16 +237,6 @@ bool QWaylandWindow::shouldCreateSubSurface() const
|
|
||||||
return QPlatformWindow::parent() != nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
-void QWaylandWindow::beginFrame()
|
|
||||||
-{
|
|
||||||
- mSurfaceLock.lockForRead();
|
|
||||||
-}
|
|
||||||
-
|
|
||||||
-void QWaylandWindow::endFrame()
|
|
||||||
-{
|
|
||||||
- mSurfaceLock.unlock();
|
|
||||||
-}
|
|
||||||
-
|
|
||||||
void QWaylandWindow::reset()
|
|
||||||
{
|
|
||||||
closeChildPopups();
|
|
||||||
@@ -256,10 +245,10 @@ void QWaylandWindow::reset()
|
|
||||||
delete mSubSurfaceWindow;
|
|
||||||
mSubSurfaceWindow = nullptr;
|
|
||||||
|
|
||||||
+ invalidateSurface();
|
|
||||||
if (mSurface) {
|
|
||||||
emit wlSurfaceDestroyed();
|
|
||||||
QWriteLocker lock(&mSurfaceLock);
|
|
||||||
- invalidateSurface();
|
|
||||||
mSurface.reset();
|
|
||||||
}
|
|
||||||
|
|
||||||
diff --git a/src/client/qwaylandwindow_p.h b/src/client/qwaylandwindow_p.h
|
|
||||||
index a8ee2696..487a91a6 100644
|
|
||||||
--- a/src/client/qwaylandwindow_p.h
|
|
||||||
+++ b/src/client/qwaylandwindow_p.h
|
|
||||||
@@ -210,9 +210,6 @@ public:
|
|
||||||
void handleUpdate();
|
|
||||||
void deliverUpdateRequest() override;
|
|
||||||
|
|
||||||
- void beginFrame();
|
|
||||||
- void endFrame();
|
|
||||||
-
|
|
||||||
void addChildPopup(QWaylandWindow* child);
|
|
||||||
void removeChildPopup(QWaylandWindow* child);
|
|
||||||
void closeChildPopups();
|
|
||||||
diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp
|
|
||||||
index 5d6fb2bf..c1f45fa6 100644
|
|
||||||
--- a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp
|
|
||||||
+++ b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp
|
|
||||||
@@ -432,10 +432,8 @@ bool QWaylandGLContext::makeCurrent(QPlatformSurface *surface)
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
- if (window->isExposed()) {
|
|
||||||
- window->beginFrame();
|
|
||||||
+ if (window->isExposed())
|
|
||||||
window->setCanResize(false);
|
|
||||||
- }
|
|
||||||
if (m_decorationsContext != EGL_NO_CONTEXT && !window->decoration())
|
|
||||||
window->createDecoration();
|
|
||||||
|
|
||||||
@@ -451,7 +449,6 @@ bool QWaylandGLContext::makeCurrent(QPlatformSurface *surface)
|
|
||||||
if (!eglMakeCurrent(m_eglDisplay, eglSurface, eglSurface, m_context)) {
|
|
||||||
qWarning("QWaylandGLContext::makeCurrent: eglError: %x, this: %p \n", eglGetError(), this);
|
|
||||||
window->setCanResize(true);
|
|
||||||
- window->endFrame();
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -505,7 +502,6 @@ void QWaylandGLContext::swapBuffers(QPlatformSurface *surface)
|
|
||||||
eglSwapBuffers(m_eglDisplay, eglSurface);
|
|
||||||
|
|
||||||
window->setCanResize(true);
|
|
||||||
- window->endFrame();
|
|
||||||
}
|
|
||||||
|
|
||||||
GLuint QWaylandGLContext::defaultFramebufferObject(QPlatformSurface *surface) const
|
|
||||||
--
|
|
||||||
2.40.0
|
|
||||||
|
|
@ -0,0 +1,38 @@
|
|||||||
|
From 173336beae7ec1007fd8d57b11e6855f4d249d37 Mon Sep 17 00:00:00 2001
|
||||||
|
From: David Redondo <qt@david-redondo.de>
|
||||||
|
Date: Tue, 11 Apr 2023 14:27:27 +0200
|
||||||
|
Subject: [PATCH 46/59] Destroy frame queue before display
|
||||||
|
|
||||||
|
wl_event_queue_destroy accesses the display.
|
||||||
|
Found by running a test under valgrind.
|
||||||
|
|
||||||
|
Pick-to: 6.5
|
||||||
|
Change-Id: Ic89cbd3b6e98b4fc9561b0e63b5fab4886a1ec50
|
||||||
|
Reviewed-by: David Edmundson <davidedmundson@kde.org>
|
||||||
|
(cherry picked from commit a76bf824fcd1cc3789f0d3454a0423c0241d9718)
|
||||||
|
---
|
||||||
|
src/client/qwaylanddisplay.cpp | 5 +++--
|
||||||
|
1 file changed, 3 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/client/qwaylanddisplay.cpp b/src/client/qwaylanddisplay.cpp
|
||||||
|
index cc321497..737b539d 100644
|
||||||
|
--- a/src/client/qwaylanddisplay.cpp
|
||||||
|
+++ b/src/client/qwaylanddisplay.cpp
|
||||||
|
@@ -379,11 +379,12 @@ QWaylandDisplay::~QWaylandDisplay(void)
|
||||||
|
#if QT_CONFIG(cursor)
|
||||||
|
qDeleteAll(mCursorThemes);
|
||||||
|
#endif
|
||||||
|
- if (mDisplay)
|
||||||
|
- wl_display_disconnect(mDisplay);
|
||||||
|
|
||||||
|
if (m_frameEventQueue)
|
||||||
|
wl_event_queue_destroy(m_frameEventQueue);
|
||||||
|
+
|
||||||
|
+ if (mDisplay)
|
||||||
|
+ wl_display_disconnect(mDisplay);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Steps which is called just after constructor. This separates registry_global() out of the constructor
|
||||||
|
--
|
||||||
|
2.46.0
|
||||||
|
|
@ -0,0 +1,42 @@
|
|||||||
|
From fa30cef910a9a57fbe2f90422789882834fdac9b Mon Sep 17 00:00:00 2001
|
||||||
|
From: David Edmundson <davidedmundson@kde.org>
|
||||||
|
Date: Wed, 7 Jun 2023 22:12:15 +0100
|
||||||
|
Subject: [PATCH 47/59] client: Fix crash on dnd updates after client facing
|
||||||
|
drag ends
|
||||||
|
|
||||||
|
A platform drag and a application-facing drag have two different
|
||||||
|
lifespans.
|
||||||
|
|
||||||
|
The platform drag lasts until all mimedata is transferred and the client
|
||||||
|
receiving the drops marks it as finished.
|
||||||
|
|
||||||
|
The application facing QDrag lasts until the client deletes it. We can
|
||||||
|
get a crash if we get updates during this time.
|
||||||
|
|
||||||
|
The drop event is guarded, but not the action negotiation.
|
||||||
|
|
||||||
|
Pick-to: 6.6
|
||||||
|
Change-Id: Ib9c047f04d65883105d4cd3f169637d0e038a63f
|
||||||
|
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
|
||||||
|
(cherry picked from commit 22daca49b807fefba58113a06b86df4274e49f62)
|
||||||
|
---
|
||||||
|
src/client/qwaylanddatadevice.cpp | 3 +++
|
||||||
|
1 file changed, 3 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/src/client/qwaylanddatadevice.cpp b/src/client/qwaylanddatadevice.cpp
|
||||||
|
index 9b3c18ac..9c3308d5 100644
|
||||||
|
--- a/src/client/qwaylanddatadevice.cpp
|
||||||
|
+++ b/src/client/qwaylanddatadevice.cpp
|
||||||
|
@@ -132,6 +132,9 @@ bool QWaylandDataDevice::startDrag(QMimeData *mimeData, Qt::DropActions supporte
|
||||||
|
connect(m_dragSource.data(), &QWaylandDataSource::cancelled, this, &QWaylandDataDevice::dragSourceCancelled);
|
||||||
|
connect(m_dragSource.data(), &QWaylandDataSource::dndResponseUpdated, this, [this](bool accepted, Qt::DropAction action) {
|
||||||
|
auto drag = static_cast<QWaylandDrag *>(QGuiApplicationPrivate::platformIntegration()->drag());
|
||||||
|
+ if (!drag->currentDrag()) {
|
||||||
|
+ return;
|
||||||
|
+ }
|
||||||
|
// in old versions drop action is not set, so we guess
|
||||||
|
if (wl_data_source_get_version(m_dragSource->object()) < 3) {
|
||||||
|
drag->setResponse(accepted);
|
||||||
|
--
|
||||||
|
2.46.0
|
||||||
|
|
@ -0,0 +1,66 @@
|
|||||||
|
From 31979df9078cad1519e8e37929fc84a9ed8f711c Mon Sep 17 00:00:00 2001
|
||||||
|
From: Michael Weghorn <m.weghorn@posteo.de>
|
||||||
|
Date: Mon, 20 Feb 2023 14:02:23 +0100
|
||||||
|
Subject: [PATCH 48/59] Convert cursor bitmap to supported format
|
||||||
|
|
||||||
|
The 1-bit image formats QImage::Format_Mono and
|
||||||
|
QImage::Format_MonoLSB used by cursor bitmaps don't have
|
||||||
|
a corresponding wl_shm_format.
|
||||||
|
|
||||||
|
Therefore, convert to a supported image format as necessary
|
||||||
|
to make such bitmap cursors work on Wayland as well.
|
||||||
|
|
||||||
|
Fixes: QTBUG-95434
|
||||||
|
Change-Id: I402fd870b301ddc01075251b66f2cf7cc1923133
|
||||||
|
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
|
||||||
|
(cherry picked from commit 45ec1362f8fcb5ade92f4d2d4985b1c24e78c8ba)
|
||||||
|
|
||||||
|
Backport changes: Use Qt::ReturnByValue version for QCursor::mask() and QCursor::bitmap()
|
||||||
|
---
|
||||||
|
src/client/qwaylandcursor.cpp | 23 ++++++++++++++++++++++-
|
||||||
|
1 file changed, 22 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/src/client/qwaylandcursor.cpp b/src/client/qwaylandcursor.cpp
|
||||||
|
index e4eca9d4..ba76ba2d 100644
|
||||||
|
--- a/src/client/qwaylandcursor.cpp
|
||||||
|
+++ b/src/client/qwaylandcursor.cpp
|
||||||
|
@@ -44,6 +44,7 @@
|
||||||
|
#include "qwaylandshmbackingstore_p.h"
|
||||||
|
|
||||||
|
#include <QtGui/QImageReader>
|
||||||
|
+#include <QBitmap>
|
||||||
|
#include <QDebug>
|
||||||
|
|
||||||
|
#include <wayland-cursor.h>
|
||||||
|
@@ -250,7 +251,27 @@ QWaylandCursor::QWaylandCursor(QWaylandDisplay *display)
|
||||||
|
QSharedPointer<QWaylandBuffer> QWaylandCursor::cursorBitmapBuffer(QWaylandDisplay *display, const QCursor *cursor)
|
||||||
|
{
|
||||||
|
Q_ASSERT(cursor->shape() == Qt::BitmapCursor);
|
||||||
|
- const QImage &img = cursor->pixmap().toImage();
|
||||||
|
+
|
||||||
|
+ const QBitmap mask = cursor->mask(Qt::ReturnByValue);
|
||||||
|
+ QImage img;
|
||||||
|
+ if (cursor->pixmap().isNull())
|
||||||
|
+ img = cursor->bitmap(Qt::ReturnByValue).toImage();
|
||||||
|
+ else
|
||||||
|
+ img = cursor->pixmap().toImage();
|
||||||
|
+
|
||||||
|
+ // convert to supported format if necessary
|
||||||
|
+ if (!display->shm()->formatSupported(img.format())) {
|
||||||
|
+ if (mask.isNull()) {
|
||||||
|
+ img.convertTo(QImage::Format_RGB32);
|
||||||
|
+ } else {
|
||||||
|
+ // preserve mask
|
||||||
|
+ img.convertTo(QImage::Format_ARGB32);
|
||||||
|
+ QPixmap pixmap = QPixmap::fromImage(img);
|
||||||
|
+ pixmap.setMask(mask);
|
||||||
|
+ img = pixmap.toImage();
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
QSharedPointer<QWaylandShmBuffer> buffer(new QWaylandShmBuffer(display, img.size(), img.format()));
|
||||||
|
memcpy(buffer->image()->bits(), img.bits(), size_t(img.sizeInBytes()));
|
||||||
|
return buffer;
|
||||||
|
--
|
||||||
|
2.46.0
|
||||||
|
|
@ -0,0 +1,169 @@
|
|||||||
|
From 6b87344bf9eab15be34ed6a86c83b19b6eb0dde2 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/59] 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.46.0
|
||||||
|
|
@ -0,0 +1,71 @@
|
|||||||
|
From 94a8ee2ce3a471753f96ede7751528f8f7f83719 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Vlad Zahorodnii <vlad.zahorodnii@kde.org>
|
||||||
|
Date: Thu, 3 Aug 2023 12:28:44 +0300
|
||||||
|
Subject: [PATCH 50/59] Client: Fix buffer damage
|
||||||
|
|
||||||
|
If the specified damage rectangle has fractional coordinates in the buffer
|
||||||
|
local coordinate space, the buffer damage needs to be expanded, i.e.
|
||||||
|
|
||||||
|
- bufferRect.left = floor(rect.left * scale)
|
||||||
|
- bufferRect.right = ceil(rect.right * scale) = ceil((rect.x + rect.width) * scale)
|
||||||
|
|
||||||
|
Flooring the coordinates and ceiling the size is not enough. It can
|
||||||
|
produce incorrect results.
|
||||||
|
|
||||||
|
For example, consider that a rectangle with logical coordinates of
|
||||||
|
QRect(0, 23, 179, 46) has been damaged in a window with scale 1.5. When
|
||||||
|
flooring the coordinates and ceiling the size, the following buffer
|
||||||
|
damage rect will be produced: QRect(0, 34, 269, 69). Its height is off by
|
||||||
|
1, the expected height is 70 (ceil((23 + 46) * 1.5) - floor(23 * 1.5) =
|
||||||
|
ceil(103.5) - floor(34.5) = 104 - 34 = 70).
|
||||||
|
|
||||||
|
Pick-to: 5.15 6.5 6.6
|
||||||
|
Change-Id: I927e75a2224bb58b4634125011d1305dbdfbb3aa
|
||||||
|
Reviewed-by: David Edmundson <davidedmundson@kde.org>
|
||||||
|
(cherry picked from commit d79db699866b37bd3e3358ca18a210dfc5c0b4b9)
|
||||||
|
---
|
||||||
|
src/client/qwaylandwindow.cpp | 20 +++++++++++++++-----
|
||||||
|
1 file changed, 15 insertions(+), 5 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp
|
||||||
|
index 38b10269..5d01507d 100644
|
||||||
|
--- a/src/client/qwaylandwindow.cpp
|
||||||
|
+++ b/src/client/qwaylandwindow.cpp
|
||||||
|
@@ -573,10 +573,15 @@ void QWaylandWindow::damage(const QRect &rect)
|
||||||
|
return;
|
||||||
|
|
||||||
|
const qreal s = scale();
|
||||||
|
- if (mDisplay->compositorVersion() >= 4)
|
||||||
|
- mSurface->damage_buffer(qFloor(s * rect.x()), qFloor(s * rect.y()), qCeil(s * rect.width()), qCeil(s * rect.height()));
|
||||||
|
- else
|
||||||
|
+ if (mDisplay->compositorVersion() >= 4) {
|
||||||
|
+ const QRect bufferRect =
|
||||||
|
+ QRectF(s * rect.x(), s * rect.y(), s * rect.width(), s * rect.height())
|
||||||
|
+ .toAlignedRect();
|
||||||
|
+ mSurface->damage_buffer(bufferRect.x(), bufferRect.y(), bufferRect.width(),
|
||||||
|
+ bufferRect.height());
|
||||||
|
+ } else {
|
||||||
|
mSurface->damage(rect.x(), rect.y(), rect.width(), rect.height());
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
|
||||||
|
void QWaylandWindow::safeCommit(QWaylandBuffer *buffer, const QRegion &damage)
|
||||||
|
@@ -614,8 +619,13 @@ void QWaylandWindow::commit(QWaylandBuffer *buffer, const QRegion &damage)
|
||||||
|
attachOffset(buffer);
|
||||||
|
if (mDisplay->compositorVersion() >= 4) {
|
||||||
|
const qreal s = scale();
|
||||||
|
- for (const QRect &rect: damage)
|
||||||
|
- mSurface->damage_buffer(qFloor(s * rect.x()), qFloor(s * rect.y()), qCeil(s * rect.width()), qCeil(s * rect.height()));
|
||||||
|
+ for (const QRect &rect : damage) {
|
||||||
|
+ const QRect bufferRect =
|
||||||
|
+ QRectF(s * rect.x(), s * rect.y(), s * rect.width(), s * rect.height())
|
||||||
|
+ .toAlignedRect();
|
||||||
|
+ mSurface->damage_buffer(bufferRect.x(), bufferRect.y(), bufferRect.width(),
|
||||||
|
+ bufferRect.height());
|
||||||
|
+ }
|
||||||
|
} else {
|
||||||
|
for (const QRect &rect: damage)
|
||||||
|
mSurface->damage(rect.x(), rect.y(), rect.width(), rect.height());
|
||||||
|
--
|
||||||
|
2.46.0
|
||||||
|
|
@ -0,0 +1,37 @@
|
|||||||
|
From 967e6ceca9e16cf5a5e92d63958057f84a1b54fd Mon Sep 17 00:00:00 2001
|
||||||
|
From: Vlad Zahorodnii <vlad.zahorodnii@kde.org>
|
||||||
|
Date: Fri, 25 Aug 2023 10:19:07 +0300
|
||||||
|
Subject: [PATCH 51/59] Client: Commit the initial surface state explicitly
|
||||||
|
|
||||||
|
QWaylandWindow lacks an explicit step to finish initializing the shell
|
||||||
|
surface by committing the surface. So far it used to work because of
|
||||||
|
hidden surface commits in
|
||||||
|
QWaylandWindow::handleContentOrientationChange(),
|
||||||
|
QWaylandWindow::setMask() and so on.
|
||||||
|
|
||||||
|
This change adds an explicit step to commit the initial surface state to
|
||||||
|
make the shell surface initialization robust.
|
||||||
|
|
||||||
|
Change-Id: Ibc38a4e0dbea689a727451c25a61af0270c7e548
|
||||||
|
Reviewed-by: David Edmundson <davidedmundson@kde.org>
|
||||||
|
(cherry picked from commit 225432c2294bdfbf24856b2f155cd274b24543b2)
|
||||||
|
---
|
||||||
|
src/client/qwaylandwindow.cpp | 2 ++
|
||||||
|
1 file changed, 2 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp
|
||||||
|
index 5d01507d..5eee0414 100644
|
||||||
|
--- a/src/client/qwaylandwindow.cpp
|
||||||
|
+++ b/src/client/qwaylandwindow.cpp
|
||||||
|
@@ -200,6 +200,8 @@ void QWaylandWindow::initWindow()
|
||||||
|
mShellSurface->requestWindowStates(window()->windowStates());
|
||||||
|
handleContentOrientationChange(window()->contentOrientation());
|
||||||
|
mFlags = window()->flags();
|
||||||
|
+
|
||||||
|
+ mSurface->commit();
|
||||||
|
}
|
||||||
|
|
||||||
|
void QWaylandWindow::initializeWlSurface()
|
||||||
|
--
|
||||||
|
2.46.0
|
||||||
|
|
@ -0,0 +1,35 @@
|
|||||||
|
From aa865b7cc8f38bd8ad4a5a0cb75effa1e7dbc9ed Mon Sep 17 00:00:00 2001
|
||||||
|
From: Vlad Zahorodnii <vlad.zahorodnii@kde.org>
|
||||||
|
Date: Fri, 15 Sep 2023 10:06:32 +0300
|
||||||
|
Subject: [PATCH 52/59] tests: Fix tst_xdgshell::minMaxSize()
|
||||||
|
|
||||||
|
Amends e8cff6fb39c0fd01548bce18542820a6612dbe49.
|
||||||
|
|
||||||
|
The new size hints will be committed when the surface is committed.
|
||||||
|
|
||||||
|
Change-Id: I94e944fee7dac63d5e9ac86fb348b5d24d54abfc
|
||||||
|
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
|
||||||
|
(cherry picked from commit d8d3d6097afeac62f1b0285e3d5365c7cb580547)
|
||||||
|
---
|
||||||
|
tests/auto/client/xdgshell/tst_xdgshell.cpp | 2 ++
|
||||||
|
1 file changed, 2 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/tests/auto/client/xdgshell/tst_xdgshell.cpp b/tests/auto/client/xdgshell/tst_xdgshell.cpp
|
||||||
|
index c5271f63..f2181fd6 100644
|
||||||
|
--- a/tests/auto/client/xdgshell/tst_xdgshell.cpp
|
||||||
|
+++ b/tests/auto/client/xdgshell/tst_xdgshell.cpp
|
||||||
|
@@ -604,9 +604,11 @@ void tst_xdgshell::minMaxSize()
|
||||||
|
QCOMPOSITOR_TRY_COMPARE(xdgToplevel()->m_committed.maxSize, QSize(1000, 1000));
|
||||||
|
|
||||||
|
window.setMaximumSize(QSize(500, 400));
|
||||||
|
+ window.update();
|
||||||
|
QCOMPOSITOR_TRY_COMPARE(xdgToplevel()->m_committed.maxSize, QSize(500, 400));
|
||||||
|
|
||||||
|
window.setMinimumSize(QSize(50, 40));
|
||||||
|
+ window.update();
|
||||||
|
QCOMPOSITOR_TRY_COMPARE(xdgToplevel()->m_committed.minSize, QSize(50, 40));
|
||||||
|
}
|
||||||
|
|
||||||
|
--
|
||||||
|
2.46.0
|
||||||
|
|
@ -1,138 +0,0 @@
|
|||||||
From 31eab11d3b6697a76cc7802d02e525c1152a42c2 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Tang Haixiang <tanghaixiang@uniontech.com>
|
|
||||||
Date: Thu, 22 Dec 2022 15:19:53 +0800
|
|
||||||
Subject: [PATCH 53/55] Client: Manage QMimeData lifecycle
|
|
||||||
|
|
||||||
QMimeData is created by user, it is not taken care of in qtwayland,
|
|
||||||
which will cause memory leak.
|
|
||||||
|
|
||||||
It is now handled in qtwayland that when a new QMimeData is set,
|
|
||||||
the previous QMimeData is freed.
|
|
||||||
|
|
||||||
Change-Id: Ic502021fe700c7ee10454d94f0d1868901809af7
|
|
||||||
Reviewed-by: David Edmundson <davidedmundson@kde.org>
|
|
||||||
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
|
|
||||||
(cherry picked from commit 3af40c6c42703a65656fdd3322183abb2905e44d)
|
|
||||||
---
|
|
||||||
src/client/qwaylandclipboard.cpp | 27 +++++++++++++++++++++------
|
|
||||||
src/client/qwaylandclipboard_p.h | 1 +
|
|
||||||
src/client/qwaylanddatasource.cpp | 5 -----
|
|
||||||
src/client/qwaylanddatasource_p.h | 2 --
|
|
||||||
4 files changed, 22 insertions(+), 13 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/src/client/qwaylandclipboard.cpp b/src/client/qwaylandclipboard.cpp
|
|
||||||
index 81f48e05..14561c77 100644
|
|
||||||
--- a/src/client/qwaylandclipboard.cpp
|
|
||||||
+++ b/src/client/qwaylandclipboard.cpp
|
|
||||||
@@ -54,10 +54,15 @@ namespace QtWaylandClient {
|
|
||||||
QWaylandClipboard::QWaylandClipboard(QWaylandDisplay *display)
|
|
||||||
: mDisplay(display)
|
|
||||||
{
|
|
||||||
+ m_clientClipboard[QClipboard::Clipboard] = nullptr;
|
|
||||||
+ m_clientClipboard[QClipboard::Selection] = nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
QWaylandClipboard::~QWaylandClipboard()
|
|
||||||
{
|
|
||||||
+ if (m_clientClipboard[QClipboard::Clipboard] != m_clientClipboard[QClipboard::Selection])
|
|
||||||
+ delete m_clientClipboard[QClipboard::Clipboard];
|
|
||||||
+ delete m_clientClipboard[QClipboard::Selection];
|
|
||||||
}
|
|
||||||
|
|
||||||
QMimeData *QWaylandClipboard::mimeData(QClipboard::Mode mode)
|
|
||||||
@@ -69,8 +74,8 @@ QMimeData *QWaylandClipboard::mimeData(QClipboard::Mode mode)
|
|
||||||
switch (mode) {
|
|
||||||
case QClipboard::Clipboard:
|
|
||||||
if (auto *dataDevice = seat->dataDevice()) {
|
|
||||||
- if (auto *source = dataDevice->selectionSource())
|
|
||||||
- return source->mimeData();
|
|
||||||
+ if (dataDevice->selectionSource())
|
|
||||||
+ return m_clientClipboard[QClipboard::Clipboard];
|
|
||||||
if (auto *offer = dataDevice->selectionOffer())
|
|
||||||
return offer->mimeData();
|
|
||||||
}
|
|
||||||
@@ -78,8 +83,8 @@ QMimeData *QWaylandClipboard::mimeData(QClipboard::Mode mode)
|
|
||||||
case QClipboard::Selection:
|
|
||||||
#if QT_CONFIG(wayland_client_primary_selection)
|
|
||||||
if (auto *selectionDevice = seat->primarySelectionDevice()) {
|
|
||||||
- if (auto *source = selectionDevice->selectionSource())
|
|
||||||
- return source->mimeData();
|
|
||||||
+ if (selectionDevice->selectionSource())
|
|
||||||
+ return m_clientClipboard[QClipboard::Selection];
|
|
||||||
if (auto *offer = selectionDevice->selectionOffer())
|
|
||||||
return offer->mimeData();
|
|
||||||
}
|
|
||||||
@@ -104,17 +109,27 @@ void QWaylandClipboard::setMimeData(QMimeData *data, QClipboard::Mode mode)
|
|
||||||
if (data && data->hasFormat(plain) && !data->hasFormat(utf8))
|
|
||||||
data->setData(utf8, data->data(plain));
|
|
||||||
|
|
||||||
+ if (m_clientClipboard[mode]) {
|
|
||||||
+ if (m_clientClipboard[QClipboard::Clipboard] != m_clientClipboard[QClipboard::Selection])
|
|
||||||
+ delete m_clientClipboard[mode];
|
|
||||||
+ m_clientClipboard[mode] = nullptr;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ m_clientClipboard[mode] = data;
|
|
||||||
+
|
|
||||||
switch (mode) {
|
|
||||||
case QClipboard::Clipboard:
|
|
||||||
if (auto *dataDevice = seat->dataDevice()) {
|
|
||||||
- dataDevice->setSelectionSource(data ? new QWaylandDataSource(mDisplay->dndSelectionHandler(), data) : nullptr);
|
|
||||||
+ dataDevice->setSelectionSource(data ? new QWaylandDataSource(mDisplay->dndSelectionHandler(),
|
|
||||||
+ m_clientClipboard[QClipboard::Clipboard]) : nullptr);
|
|
||||||
emitChanged(mode);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case QClipboard::Selection:
|
|
||||||
#if QT_CONFIG(wayland_client_primary_selection)
|
|
||||||
if (auto *selectionDevice = seat->primarySelectionDevice()) {
|
|
||||||
- selectionDevice->setSelectionSource(data ? new QWaylandPrimarySelectionSourceV1(mDisplay->primarySelectionManager(), data) : nullptr);
|
|
||||||
+ selectionDevice->setSelectionSource(data ? new QWaylandPrimarySelectionSourceV1(mDisplay->primarySelectionManager(),
|
|
||||||
+ m_clientClipboard[QClipboard::Selection]) : nullptr);
|
|
||||||
emitChanged(mode);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
diff --git a/src/client/qwaylandclipboard_p.h b/src/client/qwaylandclipboard_p.h
|
|
||||||
index ce14e124..bb52683d 100644
|
|
||||||
--- a/src/client/qwaylandclipboard_p.h
|
|
||||||
+++ b/src/client/qwaylandclipboard_p.h
|
|
||||||
@@ -80,6 +80,7 @@ public:
|
|
||||||
private:
|
|
||||||
QWaylandDisplay *mDisplay = nullptr;
|
|
||||||
QMimeData m_emptyData;
|
|
||||||
+ QMimeData *m_clientClipboard[2];
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
diff --git a/src/client/qwaylanddatasource.cpp b/src/client/qwaylanddatasource.cpp
|
|
||||||
index 5599cbd4..e085152c 100644
|
|
||||||
--- a/src/client/qwaylanddatasource.cpp
|
|
||||||
+++ b/src/client/qwaylanddatasource.cpp
|
|
||||||
@@ -71,11 +71,6 @@ QWaylandDataSource::~QWaylandDataSource()
|
|
||||||
destroy();
|
|
||||||
}
|
|
||||||
|
|
||||||
-QMimeData * QWaylandDataSource::mimeData() const
|
|
||||||
-{
|
|
||||||
- return m_mime_data;
|
|
||||||
-}
|
|
||||||
-
|
|
||||||
void QWaylandDataSource::data_source_cancelled()
|
|
||||||
{
|
|
||||||
Q_EMIT cancelled();
|
|
||||||
diff --git a/src/client/qwaylanddatasource_p.h b/src/client/qwaylanddatasource_p.h
|
|
||||||
index 96f07bc3..14d1542d 100644
|
|
||||||
--- a/src/client/qwaylanddatasource_p.h
|
|
||||||
+++ b/src/client/qwaylanddatasource_p.h
|
|
||||||
@@ -74,8 +74,6 @@ public:
|
|
||||||
QWaylandDataSource(QWaylandDataDeviceManager *dataDeviceManager, QMimeData *mimeData);
|
|
||||||
~QWaylandDataSource() override;
|
|
||||||
|
|
||||||
- QMimeData *mimeData() const;
|
|
||||||
-
|
|
||||||
Q_SIGNALS:
|
|
||||||
void cancelled();
|
|
||||||
void finished();
|
|
||||||
--
|
|
||||||
2.40.0
|
|
||||||
|
|
@ -0,0 +1,62 @@
|
|||||||
|
From 39defe8fdbaed15868bd3fdbf4a1ae638b770753 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Vlad Zahorodnii <vlad.zahorodnii@kde.org>
|
||||||
|
Date: Fri, 25 Aug 2023 10:15:29 +0300
|
||||||
|
Subject: [PATCH 53/59] Client: Remove some surface commits
|
||||||
|
|
||||||
|
The buffer transform, input and opaque regions are double buffered
|
||||||
|
state. They will be applied on the next surface commit.
|
||||||
|
|
||||||
|
But the issue with them is that the relevant code makes surface commits
|
||||||
|
too. It's undesired as it can lead to qtwayland committing partial
|
||||||
|
state, for example it can break xdg surface window geometry.
|
||||||
|
|
||||||
|
This change removes hidden surface commits. The relevant properties will
|
||||||
|
be applied on the next frame.
|
||||||
|
|
||||||
|
Change-Id: I1c40c9a5430fb6b91d7643b20d628f8a9a9d501a
|
||||||
|
Reviewed-by: David Edmundson <davidedmundson@kde.org>
|
||||||
|
(cherry picked from commit e8cff6fb39c0fd01548bce18542820a6612dbe49)
|
||||||
|
---
|
||||||
|
src/client/qwaylandwindow.cpp | 4 ----
|
||||||
|
src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp | 3 ---
|
||||||
|
2 files changed, 7 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp
|
||||||
|
index 5eee0414..7a9bccc1 100644
|
||||||
|
--- a/src/client/qwaylandwindow.cpp
|
||||||
|
+++ b/src/client/qwaylandwindow.cpp
|
||||||
|
@@ -478,8 +478,6 @@ void QWaylandWindow::setMask(const QRegion &mask)
|
||||||
|
if (isOpaque())
|
||||||
|
setOpaqueArea(mMask);
|
||||||
|
}
|
||||||
|
-
|
||||||
|
- mSurface->commit();
|
||||||
|
}
|
||||||
|
|
||||||
|
void QWaylandWindow::applyConfigureWhenPossible()
|
||||||
|
@@ -794,8 +792,6 @@ void QWaylandWindow::handleContentOrientationChange(Qt::ScreenOrientation orient
|
||||||
|
Q_UNREACHABLE();
|
||||||
|
}
|
||||||
|
mSurface->set_buffer_transform(transform);
|
||||||
|
- // set_buffer_transform is double buffered, we need to commit.
|
||||||
|
- mSurface->commit();
|
||||||
|
}
|
||||||
|
|
||||||
|
void QWaylandWindow::setOrientationMask(Qt::ScreenOrientations mask)
|
||||||
|
diff --git a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp
|
||||||
|
index 2cc36510..535c3398 100644
|
||||||
|
--- a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp
|
||||||
|
+++ b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp
|
||||||
|
@@ -367,9 +367,6 @@ bool QWaylandXdgSurface::wantsDecorations() const
|
||||||
|
void QWaylandXdgSurface::propagateSizeHints()
|
||||||
|
{
|
||||||
|
setSizeHints();
|
||||||
|
-
|
||||||
|
- if (m_toplevel && m_window)
|
||||||
|
- m_window->commit();
|
||||||
|
}
|
||||||
|
|
||||||
|
void QWaylandXdgSurface::setWindowGeometry(const QRect &rect)
|
||||||
|
--
|
||||||
|
2.46.0
|
||||||
|
|
@ -0,0 +1,69 @@
|
|||||||
|
From 14a03df4e97188a4401e6e0cf335b13e7591ed30 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Vlad Zahorodnii <vlad.zahorodnii@kde.org>
|
||||||
|
Date: Wed, 30 Aug 2023 09:49:41 +0300
|
||||||
|
Subject: [PATCH 54/59] Client: Avoid locking resizing in
|
||||||
|
QWaylandShmBackingStore
|
||||||
|
|
||||||
|
QWaylandWindow::setCanResize(false) will block applying configure
|
||||||
|
events. QWaylandWindow::setCanResize(true) will unblock configure events
|
||||||
|
and potentially apply a scheduled configure event if there's one.
|
||||||
|
|
||||||
|
QWaylandWindow::setCanResize(true) has to be called **after** committing
|
||||||
|
the surface to ensure that the xdg window geometry matches the buffer.
|
||||||
|
We don't want the xdg window geometry change when painting.
|
||||||
|
|
||||||
|
Unfortunately, setCanResize(true) can be called before the surface is
|
||||||
|
committed when using a RasterSurface, for example
|
||||||
|
|
||||||
|
- QWaylandShmBackingStore::beginPaint(): calls setCanResize(false)
|
||||||
|
- QWaylandShmBackingStore::endPaint(): calls setCanResize(true)
|
||||||
|
- QWaylandWindow::setCanResize(true): applies pending configure event
|
||||||
|
- QWaylandShmBackingStore::flush(): commits the surface, but the xdg
|
||||||
|
window geometry is wrong now
|
||||||
|
|
||||||
|
As is, beginPaint() and endPaint() are not entirely correct functions
|
||||||
|
where configure events can be blocked. We need functions that wrap both
|
||||||
|
painting and flushing, which are not feasible with the current backing
|
||||||
|
store design.
|
||||||
|
|
||||||
|
On the other hand, it's worth noting that blocking configure events in
|
||||||
|
the backing store is not necessary because painting happens on the main
|
||||||
|
thread unlike OpenGL or Vulkan code paths.
|
||||||
|
|
||||||
|
Given the lack of synchronization points and the fact that rendering
|
||||||
|
happens on the main thread, this change removes blocking configure
|
||||||
|
events in QWaylandShmBackingStore. It fixes dolphin and various other
|
||||||
|
applications that use QtWidgets jumping while being interactively
|
||||||
|
resized.
|
||||||
|
|
||||||
|
Change-Id: I156e4fd5e04a6bba7e8d48171510d5ab0ec89713
|
||||||
|
Reviewed-by: David Edmundson <davidedmundson@kde.org>
|
||||||
|
(cherry picked from commit 8828452bcf2ecf4e02a64380a1697d148c4366b0)
|
||||||
|
---
|
||||||
|
src/client/qwaylandshmbackingstore.cpp | 3 ---
|
||||||
|
1 file changed, 3 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/client/qwaylandshmbackingstore.cpp b/src/client/qwaylandshmbackingstore.cpp
|
||||||
|
index 90e37e95..145f933b 100644
|
||||||
|
--- a/src/client/qwaylandshmbackingstore.cpp
|
||||||
|
+++ b/src/client/qwaylandshmbackingstore.cpp
|
||||||
|
@@ -186,8 +186,6 @@ void QWaylandShmBackingStore::beginPaint(const QRegion ®ion)
|
||||||
|
mPainting = true;
|
||||||
|
ensureSize();
|
||||||
|
|
||||||
|
- waylandWindow()->setCanResize(false);
|
||||||
|
-
|
||||||
|
if (mBackBuffer->image()->hasAlphaChannel()) {
|
||||||
|
QPainter p(paintDevice());
|
||||||
|
p.setCompositionMode(QPainter::CompositionMode_Source);
|
||||||
|
@@ -202,7 +200,6 @@ void QWaylandShmBackingStore::endPaint()
|
||||||
|
mPainting = false;
|
||||||
|
if (mPendingFlush)
|
||||||
|
flush(window(), mPendingRegion, QPoint());
|
||||||
|
- waylandWindow()->setCanResize(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
void QWaylandShmBackingStore::ensureSize()
|
||||||
|
--
|
||||||
|
2.46.0
|
||||||
|
|
@ -1,34 +0,0 @@
|
|||||||
From 18c2bcec31f68aafd66d7ec503ec6511ca804d07 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Aleix Pol <aleixpol@kde.org>
|
|
||||||
Date: Mon, 6 Mar 2023 01:11:45 +0100
|
|
||||||
Subject: [PATCH 54/55] client: Do not cast placeholder screens to
|
|
||||||
QWaylandScreen
|
|
||||||
|
|
||||||
It's wrong to C-cast an object to a class that isn't theirs. Check if it
|
|
||||||
is a placeholder first.
|
|
||||||
|
|
||||||
Pick-to: 5.15 6.2 6.5
|
|
||||||
Change-Id: I45d3c423422ae6638a033fb0f4cfefc7cd4460f0
|
|
||||||
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
|
|
||||||
Reviewed-by: David Edmundson <davidedmundson@kde.org>
|
|
||||||
(cherry picked from commit a53f022393a1276dbf8eccbae04cb0bd6cea0160)
|
|
||||||
---
|
|
||||||
src/client/qwaylandnativeinterface.cpp | 2 +-
|
|
||||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/src/client/qwaylandnativeinterface.cpp b/src/client/qwaylandnativeinterface.cpp
|
|
||||||
index bf54a1a0..9763c312 100644
|
|
||||||
--- a/src/client/qwaylandnativeinterface.cpp
|
|
||||||
+++ b/src/client/qwaylandnativeinterface.cpp
|
|
||||||
@@ -139,7 +139,7 @@ void *QWaylandNativeInterface::nativeResourceForScreen(const QByteArray &resourc
|
|
||||||
{
|
|
||||||
QByteArray lowerCaseResource = resourceString.toLower();
|
|
||||||
|
|
||||||
- if (lowerCaseResource == "output")
|
|
||||||
+ if (lowerCaseResource == "output" && !screen->handle()->isPlaceholder())
|
|
||||||
return ((QWaylandScreen *) screen->handle())->output();
|
|
||||||
|
|
||||||
return nullptr;
|
|
||||||
--
|
|
||||||
2.40.0
|
|
||||||
|
|
@ -0,0 +1,52 @@
|
|||||||
|
From b036434381a3e8d543f4e9de8c28fb0a8770cfec Mon Sep 17 00:00:00 2001
|
||||||
|
From: David Edmundson <davidedmundson@kde.org>
|
||||||
|
Date: Wed, 17 May 2023 09:06:03 +0300
|
||||||
|
Subject: [PATCH 55/59] Client: Always populate mimedata in drags
|
||||||
|
|
||||||
|
It's possible for clients to perform a drag and drop operation within
|
||||||
|
their own client without any mimeData. A user can directly access the
|
||||||
|
original drag.
|
||||||
|
|
||||||
|
On wayland without any mimedata it's impossible for a client to accept a
|
||||||
|
drag as the mechansim involved is to either select a given mimedata
|
||||||
|
entry or an empty string. Within Qt we always accept the first format if
|
||||||
|
we accept a drag.
|
||||||
|
|
||||||
|
When dragging within our own window we also start a wayland drag so will
|
||||||
|
receive a cancel event from the compositor if the compositor doesn't
|
||||||
|
believe the client has accepted the drag.
|
||||||
|
|
||||||
|
This patch provides a dummy mimedata entry so that something can be
|
||||||
|
accepted.
|
||||||
|
|
||||||
|
Fixes: QTBUG-112161
|
||||||
|
Pick-to: 6.6 6.5 6.2 5.15
|
||||||
|
Change-Id: I6309d82e20545e10ebdb9dafde7e13a5e3be5ff2
|
||||||
|
Reviewed-by: Liang Qi <liang.qi@qt.io>
|
||||||
|
(cherry picked from commit 32fedb6fa6579711b6cb192a2e3cfb7ad1264546)
|
||||||
|
|
||||||
|
* asturmlechner 2023-10-24: Backported L1 literal as QString::fromLatin1
|
||||||
|
---
|
||||||
|
src/client/qwaylanddatadevice.cpp | 6 ++++++
|
||||||
|
1 file changed, 6 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/src/client/qwaylanddatadevice.cpp b/src/client/qwaylanddatadevice.cpp
|
||||||
|
index 9c3308d5..07b18ab0 100644
|
||||||
|
--- a/src/client/qwaylanddatadevice.cpp
|
||||||
|
+++ b/src/client/qwaylanddatadevice.cpp
|
||||||
|
@@ -124,6 +124,12 @@ bool QWaylandDataDevice::startDrag(QMimeData *mimeData, Qt::DropActions supporte
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ // dragging data without mimetypes is a legal operation in Qt terms
|
||||||
|
+ // but Wayland uses a mimetype to determine if a drag is accepted or not
|
||||||
|
+ // In this rare case, insert a placeholder
|
||||||
|
+ if (mimeData->formats().isEmpty())
|
||||||
|
+ mimeData->setData(QString::fromLatin1("application/x-qt-avoid-empty-placeholder"), QByteArray("1"));
|
||||||
|
+
|
||||||
|
m_dragSource.reset(new QWaylandDataSource(m_display->dndSelectionHandler(), mimeData));
|
||||||
|
|
||||||
|
if (wl_data_device_get_version(object()) >= 3)
|
||||||
|
--
|
||||||
|
2.46.0
|
||||||
|
|
@ -1,41 +0,0 @@
|
|||||||
From c4c3fc69250c01cb35aaae5ea1ea2bcc8236dff0 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Vlad Zahorodnii <vlad.zahorodnii@kde.org>
|
|
||||||
Date: Thu, 12 Jan 2023 14:49:25 +0200
|
|
||||||
Subject: [PATCH 55/55] Client: Remove flip popup constraints
|
|
||||||
|
|
||||||
xdg_positioner doesn't have good anchor rect and other needed
|
|
||||||
information so the compositor can properly flip popups. In some windows
|
|
||||||
I see that some popups are flipped in such a way that the popups look
|
|
||||||
"detached" from the parent window.
|
|
||||||
|
|
||||||
With the information that QtWayland provides so far only slide
|
|
||||||
constraint adjustments can produce somewhat expected results. Although
|
|
||||||
there will be still some issues near screen edges.
|
|
||||||
|
|
||||||
Pick-to: 6.5 6.4 6.2 5.15
|
|
||||||
Task-number: QTBUG-87303
|
|
||||||
Change-Id: I4021f497b78e62651fe606c4be21a387a92edd6c
|
|
||||||
Reviewed-by: Liang Qi <liang.qi@qt.io>
|
|
||||||
(cherry picked from commit d7a5dab0182cba19d7f59e542672aa3d1b2e859e)
|
|
||||||
---
|
|
||||||
src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp | 4 +---
|
|
||||||
1 file changed, 1 insertion(+), 3 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp
|
|
||||||
index ad666129..822b385c 100644
|
|
||||||
--- a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp
|
|
||||||
+++ b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp
|
|
||||||
@@ -425,9 +425,7 @@ void QWaylandXdgSurface::setPopup(QWaylandWindow *parent)
|
|
||||||
positioner->set_gravity(QtWayland::xdg_positioner::gravity_bottom_right);
|
|
||||||
positioner->set_size(m_window->geometry().width(), m_window->geometry().height());
|
|
||||||
positioner->set_constraint_adjustment(QtWayland::xdg_positioner::constraint_adjustment_slide_x
|
|
||||||
- | QtWayland::xdg_positioner::constraint_adjustment_slide_y
|
|
||||||
- | QtWayland::xdg_positioner::constraint_adjustment_flip_x
|
|
||||||
- | QtWayland::xdg_positioner::constraint_adjustment_flip_y);
|
|
||||||
+ | QtWayland::xdg_positioner::constraint_adjustment_slide_y);
|
|
||||||
m_popup = new Popup(this, parent, positioner);
|
|
||||||
positioner->destroy();
|
|
||||||
|
|
||||||
--
|
|
||||||
2.40.0
|
|
||||||
|
|
@ -0,0 +1,60 @@
|
|||||||
|
From 7d288c916311a70b16c3a310b7a36862ce4c2268 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Ilya Fedin <fedin-ilja2010@ya.ru>
|
||||||
|
Date: Sun, 3 Dec 2023 19:12:03 +0400
|
||||||
|
Subject: [PATCH 56/59] Client: Fix enter event cursor position with xdg-popup
|
||||||
|
and QHighDpiScaling
|
||||||
|
|
||||||
|
QWindowSystemInterface::handleEnterEvent accepts device-dependent
|
||||||
|
position while QCursor::pos provides device-independent position.
|
||||||
|
|
||||||
|
Use QWaylandCursor::pos instead.
|
||||||
|
|
||||||
|
Pick-to: 6.6 6.5 6.2 5.15
|
||||||
|
Change-Id: I70d2997610f7a34c6763bd4f10f20a65c3debdbe
|
||||||
|
Reviewed-by: David Edmundson <davidedmundson@kde.org>
|
||||||
|
(cherry picked from commit 8e57e8b51b2b701c5520f37b7d78de5b3c488500)
|
||||||
|
---
|
||||||
|
.../shellintegration/xdg-shell/qwaylandxdgshell.cpp | 13 +++++++++----
|
||||||
|
1 file changed, 9 insertions(+), 4 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp
|
||||||
|
index 535c3398..9c6cbb81 100644
|
||||||
|
--- a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp
|
||||||
|
+++ b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp
|
||||||
|
@@ -44,6 +44,7 @@
|
||||||
|
#include <QtWaylandClient/private/qwaylandwindow_p.h>
|
||||||
|
#include <QtWaylandClient/private/qwaylandinputdevice_p.h>
|
||||||
|
#include <QtWaylandClient/private/qwaylandscreen_p.h>
|
||||||
|
+#include <QtWaylandClient/private/qwaylandcursor_p.h>
|
||||||
|
#include <QtWaylandClient/private/qwaylandabstractdecoration_p.h>
|
||||||
|
|
||||||
|
#include <QtGui/private/qwindow_p.h>
|
||||||
|
@@ -229,8 +230,10 @@ QWaylandXdgSurface::Popup::~Popup()
|
||||||
|
leave = m_xdgSurface->window()->window();
|
||||||
|
QWindowSystemInterface::handleLeaveEvent(leave);
|
||||||
|
|
||||||
|
- if (QWindow *enter = QGuiApplication::topLevelAt(QCursor::pos()))
|
||||||
|
- QWindowSystemInterface::handleEnterEvent(enter, enter->mapFromGlobal(QCursor::pos()), QCursor::pos());
|
||||||
|
+ if (QWindow *enter = QGuiApplication::topLevelAt(QCursor::pos())) {
|
||||||
|
+ const auto pos = m_xdgSurface->window()->display()->waylandCursor()->pos();
|
||||||
|
+ QWindowSystemInterface::handleEnterEvent(enter, enter->handle()->mapFromGlobal(pos), pos);
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -462,8 +465,10 @@ void QWaylandXdgSurface::setGrabPopup(QWaylandWindow *parent, QWaylandInputDevic
|
||||||
|
if (m_popup && m_popup->m_xdgSurface && m_popup->m_xdgSurface->window())
|
||||||
|
enter = m_popup->m_xdgSurface->window()->window();
|
||||||
|
|
||||||
|
- if (enter)
|
||||||
|
- QWindowSystemInterface::handleEnterEvent(enter, enter->mapFromGlobal(QCursor::pos()), QCursor::pos());
|
||||||
|
+ if (enter) {
|
||||||
|
+ const auto pos = m_popup->m_xdgSurface->window()->display()->waylandCursor()->pos();
|
||||||
|
+ QWindowSystemInterface::handleEnterEvent(enter, enter->handle()->mapFromGlobal(pos), pos);
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
|
||||||
|
void QWaylandXdgSurface::xdg_surface_configure(uint32_t serial)
|
||||||
|
--
|
||||||
|
2.46.0
|
||||||
|
|
@ -0,0 +1,47 @@
|
|||||||
|
From 7007e9aa55fbb292a225fee83ef647c1b37509be Mon Sep 17 00:00:00 2001
|
||||||
|
From: Liang Qi <liang.qi@qt.io>
|
||||||
|
Date: Wed, 13 Mar 2024 11:53:58 +0100
|
||||||
|
Subject: [PATCH 57/59] client: don't cache one type in QWaylandMimeData
|
||||||
|
|
||||||
|
"application/vnd.portal.filetransfer", which is only valid for one
|
||||||
|
time use.
|
||||||
|
|
||||||
|
Fixes: QTBUG-107858
|
||||||
|
Pick-to: 6.7 6.6 6.5 6.2 5.15
|
||||||
|
Change-Id: I094de22ea0bb9b3577572e6c57ebe42cdc8c7b41
|
||||||
|
Reviewed-by: David Edmundson <davidedmundson@kde.org>
|
||||||
|
(cherry picked from commit 19758eb4093e8d60c69f75174afb7457490e2332)
|
||||||
|
---
|
||||||
|
src/client/qwaylanddataoffer.cpp | 9 ++++++++-
|
||||||
|
1 file changed, 8 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/src/client/qwaylanddataoffer.cpp b/src/client/qwaylanddataoffer.cpp
|
||||||
|
index fe0ea8c9..0241a1df 100644
|
||||||
|
--- a/src/client/qwaylanddataoffer.cpp
|
||||||
|
+++ b/src/client/qwaylanddataoffer.cpp
|
||||||
|
@@ -56,6 +56,11 @@ static QString utf8Text()
|
||||||
|
return QStringLiteral("text/plain;charset=utf-8");
|
||||||
|
}
|
||||||
|
|
||||||
|
+static QString portalFileTransfer()
|
||||||
|
+{
|
||||||
|
+ return QStringLiteral("application/vnd.portal.filetransfer");
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
QWaylandDataOffer::QWaylandDataOffer(QWaylandDisplay *display, struct ::wl_data_offer *offer)
|
||||||
|
: QtWayland::wl_data_offer(offer)
|
||||||
|
, m_display(display)
|
||||||
|
@@ -182,7 +187,9 @@ QVariant QWaylandMimeData::retrieveData_sys(const QString &mimeType, QVariant::T
|
||||||
|
}
|
||||||
|
|
||||||
|
close(pipefd[0]);
|
||||||
|
- m_data.insert(mimeType, content);
|
||||||
|
+ if (mimeType != portalFileTransfer())
|
||||||
|
+ m_data.insert(mimeType, content);
|
||||||
|
+
|
||||||
|
return content;
|
||||||
|
}
|
||||||
|
|
||||||
|
--
|
||||||
|
2.46.0
|
||||||
|
|
@ -0,0 +1,76 @@
|
|||||||
|
From e1a146806873879c380486f084a990936c5fa537 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
|
||||||
|
Date: Fri, 10 May 2024 13:20:30 +0200
|
||||||
|
Subject: [PATCH 58/59] Fix race condition in drag and drop
|
||||||
|
|
||||||
|
The data source may be deleted by libwayland while we hold a
|
||||||
|
reference to it. This could cause crashes when dragging
|
||||||
|
and dropping repeatedly and very rapidly between two
|
||||||
|
components.
|
||||||
|
|
||||||
|
Tapping into sourceDestroyed() for this as well allows us to
|
||||||
|
recover more gracefully.
|
||||||
|
|
||||||
|
This also required adding some null pointer checks to the code,
|
||||||
|
since it wasn't really prepared for the data source
|
||||||
|
disappearing.
|
||||||
|
|
||||||
|
Pick-to: 5.15 6.2 6.5 6.7 6.8
|
||||||
|
Fixes: QTBUG-124502
|
||||||
|
Change-Id: Ic3df8bf70176c5424ac5c693f8456f61e7b2762b
|
||||||
|
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
|
||||||
|
(cherry picked from commit 792bd8510e3bc6b47bcaedfb1386390ce3a10a3a)
|
||||||
|
---
|
||||||
|
src/compositor/wayland_wrapper/qwldatadevice.cpp | 15 +++++++++++----
|
||||||
|
1 file changed, 11 insertions(+), 4 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/compositor/wayland_wrapper/qwldatadevice.cpp b/src/compositor/wayland_wrapper/qwldatadevice.cpp
|
||||||
|
index a3a795f9..f301678e 100644
|
||||||
|
--- a/src/compositor/wayland_wrapper/qwldatadevice.cpp
|
||||||
|
+++ b/src/compositor/wayland_wrapper/qwldatadevice.cpp
|
||||||
|
@@ -76,6 +76,9 @@ void DataDevice::sourceDestroyed(DataSource *source)
|
||||||
|
{
|
||||||
|
if (m_selectionSource == source)
|
||||||
|
m_selectionSource = nullptr;
|
||||||
|
+
|
||||||
|
+ if (m_dragDataSource == source)
|
||||||
|
+ m_dragDataSource = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if QT_CONFIG(draganddrop)
|
||||||
|
@@ -105,9 +108,11 @@ void DataDevice::setDragFocus(QWaylandSurface *focus, const QPointF &localPositi
|
||||||
|
if (m_dragDataSource && !offer)
|
||||||
|
return;
|
||||||
|
|
||||||
|
- send_enter(resource->handle, serial, focus->resource(),
|
||||||
|
- wl_fixed_from_double(localPosition.x()), wl_fixed_from_double(localPosition.y()),
|
||||||
|
- offer->resource()->handle);
|
||||||
|
+ if (offer) {
|
||||||
|
+ send_enter(resource->handle, serial, focus->resource(),
|
||||||
|
+ wl_fixed_from_double(localPosition.x()), wl_fixed_from_double(localPosition.y()),
|
||||||
|
+ offer->resource()->handle);
|
||||||
|
+ }
|
||||||
|
|
||||||
|
m_dragFocus = focus;
|
||||||
|
m_dragFocusResource = resource;
|
||||||
|
@@ -139,7 +144,7 @@ void DataDevice::drop()
|
||||||
|
if (m_dragFocusResource) {
|
||||||
|
send_drop(m_dragFocusResource->handle);
|
||||||
|
setDragFocus(nullptr, QPoint());
|
||||||
|
- } else {
|
||||||
|
+ } else if (m_dragDataSource) {
|
||||||
|
m_dragDataSource->cancel();
|
||||||
|
}
|
||||||
|
m_dragOrigin = nullptr;
|
||||||
|
@@ -155,6 +160,8 @@ void DataDevice::data_device_start_drag(Resource *resource, struct ::wl_resource
|
||||||
|
{
|
||||||
|
m_dragClient = resource->client();
|
||||||
|
m_dragDataSource = source ? DataSource::fromResource(source) : nullptr;
|
||||||
|
+ if (m_dragDataSource)
|
||||||
|
+ m_dragDataSource->setDevice(this);
|
||||||
|
m_dragOrigin = QWaylandSurface::fromResource(origin);
|
||||||
|
QWaylandDrag *drag = m_seat->drag();
|
||||||
|
setDragIcon(icon ? QWaylandSurface::fromResource(icon) : nullptr);
|
||||||
|
--
|
||||||
|
2.46.0
|
||||||
|
|
@ -0,0 +1,75 @@
|
|||||||
|
From 6b1ba1cd0e1389d13e59b94e65da8f20a89ba03f Mon Sep 17 00:00:00 2001
|
||||||
|
From: Liang Qi <liang.qi@qt.io>
|
||||||
|
Date: Wed, 6 Sep 2023 11:04:02 +0200
|
||||||
|
Subject: [PATCH 59/59] Revert "Client: Send release button event on pointer
|
||||||
|
leave"
|
||||||
|
|
||||||
|
This reverts commit 8235fa65fe033a94e7a44322d3502f25940092ec.
|
||||||
|
|
||||||
|
It makes tests/manual/examples/widgets/draganddrop/puzzle not work,
|
||||||
|
which does drag and drop in same app.
|
||||||
|
|
||||||
|
Pick-to: 6.6 6.5 6.2 5.15
|
||||||
|
Fixes: QTBUG-115757
|
||||||
|
Task-number: QTBUG-97037
|
||||||
|
Change-Id: I738769fde96f7da91f5bc4dc7a70ed49596dcd61
|
||||||
|
Reviewed-by: Liang Qi <liang.qi@qt.io>
|
||||||
|
(cherry picked from commit 60647fa069ef4143642ae4c1b529ad2a7a7f2fd9)
|
||||||
|
---
|
||||||
|
src/client/qwaylandinputdevice.cpp | 9 ++-------
|
||||||
|
src/client/qwaylandinputdevice_p.h | 1 -
|
||||||
|
2 files changed, 2 insertions(+), 8 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/client/qwaylandinputdevice.cpp b/src/client/qwaylandinputdevice.cpp
|
||||||
|
index 74f16b70..ab978d3f 100644
|
||||||
|
--- a/src/client/qwaylandinputdevice.cpp
|
||||||
|
+++ b/src/client/qwaylandinputdevice.cpp
|
||||||
|
@@ -688,8 +688,8 @@ public:
|
||||||
|
|
||||||
|
void QWaylandInputDevice::Pointer::pointer_leave(uint32_t time, struct wl_surface *surface)
|
||||||
|
{
|
||||||
|
- releaseButtons();
|
||||||
|
invalidateFocus();
|
||||||
|
+ mButtons = Qt::NoButton;
|
||||||
|
|
||||||
|
mParent->mTime = time;
|
||||||
|
|
||||||
|
@@ -804,8 +804,6 @@ void QWaylandInputDevice::Pointer::pointer_button(uint32_t serial, uint32_t time
|
||||||
|
default: return; // invalid button number (as far as Qt is concerned)
|
||||||
|
}
|
||||||
|
|
||||||
|
- mLastButton = qt_button;
|
||||||
|
-
|
||||||
|
if (state)
|
||||||
|
mButtons |= qt_button;
|
||||||
|
else
|
||||||
|
@@ -844,13 +842,10 @@ void QWaylandInputDevice::Pointer::invalidateFocus()
|
||||||
|
|
||||||
|
void QWaylandInputDevice::Pointer::releaseButtons()
|
||||||
|
{
|
||||||
|
- if (mButtons == Qt::NoButton)
|
||||||
|
- return;
|
||||||
|
-
|
||||||
|
mButtons = Qt::NoButton;
|
||||||
|
|
||||||
|
if (auto *window = focusWindow()) {
|
||||||
|
- ReleaseEvent e(focusWindow(), mParent->mTime, mSurfacePos, mGlobalPos, mButtons, mLastButton, mParent->modifiers());
|
||||||
|
+ ReleaseEvent e(focusWindow(), mParent->mTime, mSurfacePos, mGlobalPos, mButtons, Qt::NoButton, mParent->modifiers());
|
||||||
|
window->handleMouse(mParent, e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
diff --git a/src/client/qwaylandinputdevice_p.h b/src/client/qwaylandinputdevice_p.h
|
||||||
|
index bafe3db2..5795f138 100644
|
||||||
|
--- a/src/client/qwaylandinputdevice_p.h
|
||||||
|
+++ b/src/client/qwaylandinputdevice_p.h
|
||||||
|
@@ -346,7 +346,6 @@ public:
|
||||||
|
QPointF mSurfacePos;
|
||||||
|
QPointF mGlobalPos;
|
||||||
|
Qt::MouseButtons mButtons = Qt::NoButton;
|
||||||
|
- Qt::MouseButton mLastButton = Qt::NoButton;
|
||||||
|
#if QT_CONFIG(cursor)
|
||||||
|
wl_buffer *mCursorBuffer = nullptr;
|
||||||
|
Qt::CursorShape mCursorShape = Qt::BitmapCursor;
|
||||||
|
--
|
||||||
|
2.46.0
|
||||||
|
|
@ -0,0 +1,29 @@
|
|||||||
|
From e6634936ab661a9b6303d1318392ea109a17dad4 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Rob Hall <robxnanocode@outlook.com>
|
||||||
|
Date: Sun, 24 Dec 2023 21:46:48 +0000
|
||||||
|
Subject: [PATCH] client: Fix window margin calculation
|
||||||
|
|
||||||
|
Don't subtract the size of the window frame margin from the content
|
||||||
|
area. Fixes an issue where an area of the window is unclickable when
|
||||||
|
client-side decorations are in use.
|
||||||
|
|
||||||
|
Fixes: QTBUG-120392
|
||||||
|
Pick-to: 6.7 6.6 6.5
|
||||||
|
Change-Id: I6a89b2d463be084233ea3448cacfbbd09d66b96e
|
||||||
|
---
|
||||||
|
|
||||||
|
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp
|
||||||
|
index 610cc9e..bb71638 100644
|
||||||
|
--- a/src/client/qwaylandwindow.cpp
|
||||||
|
+++ b/src/client/qwaylandwindow.cpp
|
||||||
|
@@ -1360,8 +1360,8 @@
|
||||||
|
QMargins marg = frameMargins();
|
||||||
|
QRect windowRect(0 + marg.left(),
|
||||||
|
0 + marg.top(),
|
||||||
|
- geometry().size().width() - marg.right(),
|
||||||
|
- geometry().size().height() - marg.bottom());
|
||||||
|
+ geometry().size().width(),
|
||||||
|
+ geometry().size().height());
|
||||||
|
if (windowRect.contains(e.local.toPoint()) || mMousePressedInContentArea != Qt::NoButton) {
|
||||||
|
const QPointF localTranslated = mapFromWlSurface(e.local);
|
||||||
|
QPointF globalTranslated = e.global;
|
@ -0,0 +1,14 @@
|
|||||||
|
diff --git a/src/client/qwaylandintegration.cpp b/src/client/qwaylandintegration.cpp
|
||||||
|
index 13bacc9b..7c35003d 100644
|
||||||
|
--- a/src/client/qwaylandintegration.cpp
|
||||||
|
+++ b/src/client/qwaylandintegration.cpp
|
||||||
|
@@ -88,6 +88,9 @@ QWaylandIntegration::QWaylandIntegration()
|
||||||
|
|
||||||
|
QWaylandWindow::fixedToplevelPositions =
|
||||||
|
!qEnvironmentVariableIsSet("QT_WAYLAND_DISABLE_FIXED_POSITIONS");
|
||||||
|
+
|
||||||
|
+ if (!qEnvironmentVariableIsSet("QT_WAYLAND_DECORATION"))
|
||||||
|
+ qputenv("QT_WAYLAND_DECORATION", "adwaita");
|
||||||
|
}
|
||||||
|
|
||||||
|
QWaylandIntegration::~QWaylandIntegration()
|
Loading…
Reference in new issue