This commit is contained in:
Jan Grulich 2022-09-20 17:38:03 +02:00
parent 137ccdd1d4
commit d2744e8950
51 changed files with 1039 additions and 235 deletions

1
.gitignore vendored
View File

@ -13,3 +13,4 @@
/qtwayland-everywhere-opensource-src-5.15.3.tar.xz
/qtwayland-everywhere-opensource-src-5.15.4.tar.xz
/qtwayland-everywhere-opensource-src-5.15.5.tar.xz
/qtwayland-everywhere-opensource-src-5.15.6.tar.xz

View File

@ -1,7 +1,7 @@
From 03d56082a21894ff21e08042e21fed46dc0c69a3 Mon Sep 17 00:00:00 2001
From dc898504f36bc7edd7113cfa74ed08dedd5453cf Mon Sep 17 00:00:00 2001
From: Vlad Zahorodnii <vlad.zahorodnii@kde.org>
Date: Wed, 5 May 2021 20:49:26 +0300
Subject: [PATCH 01/39] Client: Announce an output after receiving more
Subject: [PATCH 01/47] Client: Announce an output after receiving more
complete state
Output initialization is not atomic, meaning that the compositor may
@ -142,5 +142,5 @@ index df1c94f2..050cfdc0 100644
#if QT_CONFIG(cursor)
--
2.36.1
2.37.3

View File

@ -1,7 +1,7 @@
From 757fbedba864de49bae89b390be22031b06eec1a Mon Sep 17 00:00:00 2001
From fd88c188f4b2a0c2dd1aed496926606dc770c220 Mon Sep 17 00:00:00 2001
From: Jaeyoon Jung <jaeyoon.jung@lge.com>
Date: Mon, 15 Feb 2021 08:31:06 +0900
Subject: [PATCH 02/39] Fix issue with repeated window size changes
Subject: [PATCH 02/47] Fix issue with repeated window size changes
Check if the new window size is different from the size requested
previously before calling wl_egl_window_resize. It addresses the issue
@ -54,5 +54,5 @@ index 5b1f4d56..0079dfef 100644
}
--
2.36.1
2.37.3

View File

@ -1,7 +1,7 @@
From 162ac52924127add2ba1c14cef3b42a58a977243 Mon Sep 17 00:00:00 2001
From 72eee300b30717ed4484fddfcfab66293a845194 Mon Sep 17 00:00:00 2001
From: David Edmundson <davidedmundson@kde.org>
Date: Tue, 9 Feb 2021 16:09:21 +0000
Subject: [PATCH 03/39] Client: Connect drags being accepted to updating the
Subject: [PATCH 03/47] Client: Connect drags being accepted to updating the
source drag icon
Currently in a multi-process drag and drop when the other client accepts
@ -35,5 +35,5 @@ index 19944a34..54a69c3c 100644
start_drag(m_dragSource->object(), origin->wlSurface(), icon->wlSurface(), m_display->currentInputDevice()->serial());
return true;
--
2.36.1
2.37.3

View File

@ -1,7 +1,7 @@
From f06ea86e2fb0ef601fb22109d5eebe246e009aff Mon Sep 17 00:00:00 2001
From b30dce259b51da2894a2b50c20d52aaee3f4845e Mon Sep 17 00:00:00 2001
From: David Edmundson <davidedmundson@kde.org>
Date: Fri, 14 May 2021 13:23:24 +0100
Subject: [PATCH 04/39] Client: Disconnect registry listener on destruction
Subject: [PATCH 04/47] Client: Disconnect registry listener on destruction
If a display outlives a QWaylandClientExtension and a new global is
announced we end up delivering an event to a now deleted extension which
@ -45,5 +45,5 @@ index 98272e57..5bd28398 100644
QtWaylandClient::QWaylandIntegration *integration() const;
int version() const;
--
2.36.1
2.37.3

View File

@ -1,7 +1,7 @@
From ed636d45ea1fb5e89a03492be7b6c22ead7c8713 Mon Sep 17 00:00:00 2001
From 5d3ff18b89300186fd51baa63693d74c803c1575 Mon Sep 17 00:00:00 2001
From: David Edmundson <davidedmundson@kde.org>
Date: Mon, 3 May 2021 23:01:53 +0100
Subject: [PATCH 05/39] Client: Set XdgShell size hints before the first commit
Subject: [PATCH 05/47] Client: Set XdgShell size hints before the first commit
propagateSizeHints is only called in QWindow we have platform window and
minimumSizeHint is then sent. We also need to send existing hints when
@ -54,5 +54,5 @@ index 2277bbb8..2fdd0a7c 100644
QCOMPOSITOR_TRY_COMPARE(xdgToplevel()->m_committed.minSize, QSize(100, 100));
QCOMPOSITOR_TRY_COMPARE(xdgToplevel()->m_committed.maxSize, QSize(1000, 1000));
--
2.36.1
2.37.3

View File

@ -1,7 +1,7 @@
From 3ee59137a0f58e8ac36b94532476e9a60d24cf6c Mon Sep 17 00:00:00 2001
From 29f95b057ec9edec9ae793ac9eecbe66de024fe6 Mon Sep 17 00:00:00 2001
From: David Edmundson <davidedmundson@kde.org>
Date: Mon, 14 Jun 2021 12:45:37 +0100
Subject: [PATCH 06/39] Fix build
Subject: [PATCH 06/47] Fix build
1b5e43a593e917610e6245f7a272ac081c508ba4 relied on a patch that we can't
backport.
@ -42,5 +42,5 @@ index 69cc46a0..9091efbe 100644
class Q_WAYLAND_CLIENT_EXPORT QWaylandClientExtensionTemplatePrivate : public QWaylandClientExtensionPrivate
--
2.36.1
2.37.3

View File

@ -1,7 +1,7 @@
From 958ffd9ae97d17b630d2d30cfb9f309a9c313dc5 Mon Sep 17 00:00:00 2001
From d50de48c698799c7522f460c9f5ad17af20409f0 Mon Sep 17 00:00:00 2001
From: Zhang Liang <zhanglianga@uniontech.com>
Date: Mon, 1 Feb 2021 19:29:43 +0800
Subject: [PATCH 07/39] Fix: remove listener
Subject: [PATCH 07/47] Fix: remove listener
Add the operation for removing the listener form listener list
@ -29,5 +29,5 @@ index f10c1f79..e0dfe8b2 100644
uint32_t QWaylandDisplay::currentTimeMillisec()
--
2.36.1
2.37.3

View File

@ -1,7 +1,7 @@
From 27869240e937e97a386b580a126246d0b064e7ce Mon Sep 17 00:00:00 2001
From 5553201fa28bc4d868ed2ffb70951063b642abfd Mon Sep 17 00:00:00 2001
From: David Redondo <qt@david-redondo.de>
Date: Wed, 26 May 2021 14:49:40 +0200
Subject: [PATCH 08/39] Hook up queryKeyboardModifers
Subject: [PATCH 08/47] Hook up queryKeyboardModifers
Can be useful when upon enter a modifiers event is received but no key
event so no QKeyEvent is generated.
@ -51,5 +51,5 @@ index ff70ae25..73b80658 100644
QStringList themeNames() const override;
--
2.36.1
2.37.3

View File

@ -1,7 +1,7 @@
From 18d9848160962063d4735e5f15518f76936da692 Mon Sep 17 00:00:00 2001
From 9904bc47054d44f414ace894bf36093ee7a1b37a Mon Sep 17 00:00:00 2001
From: Jan Blackquill <uhhadd@gmail.com>
Date: Tue, 24 Aug 2021 14:36:34 -0400
Subject: [PATCH 10/39] Correctly detect if image format is supported by
Subject: [PATCH 09/47] Correctly detect if image format is supported by
QImageWriter
The code queries potential image formats by stripping a mimetype of its
@ -64,5 +64,5 @@ index a5fdd34d..051a91dc 100644
fmt = imgFmt;
}
--
2.36.1
2.37.3

View File

@ -1,44 +0,0 @@
From 29289cca0c74104b61f6d201c392a41597e9a723 Mon Sep 17 00:00:00 2001
From: Aleix Pol <aleixpol@kde.org>
Date: Tue, 13 Jul 2021 13:32:15 +0200
Subject: [PATCH 09/39] Do not update the mask if we do not have a surface
mMask serves as a cache to remember what we've sent, the source of truth
for the value is window()->mask().
No need to store values that we are going to discard, because it will
confuse the state of newly created windows.
Change-Id: I6aa3da82c7f09c7ef90d0f7060f292fb042730f0
Pick-to: 5.15 6.2
Reviewed-by: David Edmundson <davidedmundson@kde.org>
(cherry picked from commit 962f87190c682562b369c5ebd93dc9ce0915ed7a)
---
src/client/qwaylandwindow.cpp | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp
index e96d8fe9..bd70f4af 100644
--- a/src/client/qwaylandwindow.cpp
+++ b/src/client/qwaylandwindow.cpp
@@ -464,14 +464,15 @@ void QWaylandWindow::lower()
void QWaylandWindow::setMask(const QRegion &mask)
{
+ QReadLocker locker(&mSurfaceLock);
+ if (!mSurface)
+ return;
+
if (mMask == mask)
return;
mMask = mask;
- if (!mSurface)
- return;
-
if (mMask.isEmpty()) {
mSurface->set_input_region(nullptr);
--
2.36.1

View File

@ -1,7 +1,7 @@
From 67cdc477f2702c27fdc0a17b0385864891c7aaf3 Mon Sep 17 00:00:00 2001
From 56c6dd31c9e3bead6b2435b1fb0a02023eab5bcc Mon Sep 17 00:00:00 2001
From: Paul Olav Tvete <paul.tvete@qt.io>
Date: Tue, 14 Sep 2021 11:56:23 +0200
Subject: [PATCH 11/39] Wayland client: Fix crash when windows are shown/hidden
Subject: [PATCH 10/47] Wayland client: Fix crash when windows are shown/hidden
during drag
Fixes: QTBUG-87624
@ -27,5 +27,5 @@ index 54a69c3c..bbd2d568 100644
return; // Ignore foreign surfaces
--
2.36.1
2.37.3

View File

@ -1,7 +1,7 @@
From e26ccadfa921f64eca1e31450e60778d11867924 Mon Sep 17 00:00:00 2001
From aa701858908ced79f5ebe4f30907ebbe7566e238 Mon Sep 17 00:00:00 2001
From: Georges Basile Stavracas Neto <gbsneto@gnome.org>
Date: Thu, 27 May 2021 19:55:04 -0300
Subject: [PATCH 12/39] Client: Don't always recreate frame callbacks
Subject: [PATCH 11/47] Client: Don't always recreate frame callbacks
The main QWaylandWindow method that is executed when handling updates is
QWaylandWindow::handleUpdate(). This method always, unconditionally queues
@ -38,10 +38,10 @@ Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2 files changed, 6 insertions(+)
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp
index bd70f4af..85307875 100644
index afdebf55..14254f08 100644
--- a/src/client/qwaylandwindow.cpp
+++ b/src/client/qwaylandwindow.cpp
@@ -1170,6 +1170,10 @@ void QWaylandWindow::requestUpdate()
@@ -1185,6 +1185,10 @@ void QWaylandWindow::requestUpdate()
void QWaylandWindow::handleUpdate()
{
qCDebug(lcWaylandBackingstore) << "handleUpdate" << QThread::currentThread();
@ -73,5 +73,5 @@ index 2fdd0a7c..e2593314 100644
void tst_xdgshell::popup()
--
2.36.1
2.37.3

View File

@ -1,7 +1,7 @@
From e9b6a15c0677c7a1c6b93654b79be96880de9085 Mon Sep 17 00:00:00 2001
From b9f26b7d68a39785f5bf4dbe165dcc6bec8ac144 Mon Sep 17 00:00:00 2001
From: Georges Basile Stavracas Neto <gbsneto@gnome.org>
Date: Thu, 27 May 2021 20:02:53 -0300
Subject: [PATCH 13/39] Client: Always destroy frame callback in the actual
Subject: [PATCH 12/47] Client: Always destroy frame callback in the actual
callback
It's good hygiene to destroy all frame callbacks. Destroy the
@ -23,10 +23,10 @@ Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp
index 85307875..c020a58f 100644
index 14254f08..afef6c0b 100644
--- a/src/client/qwaylandwindow.cpp
+++ b/src/client/qwaylandwindow.cpp
@@ -622,9 +622,13 @@ void QWaylandWindow::commit()
@@ -635,9 +635,13 @@ void QWaylandWindow::commit()
const wl_callback_listener QWaylandWindow::callbackListener = {
[](void *data, wl_callback *callback, uint32_t time) {
@ -41,7 +41,7 @@ index 85307875..c020a58f 100644
window->handleFrameCallback();
}
};
@@ -1179,11 +1183,6 @@ void QWaylandWindow::handleUpdate()
@@ -1194,11 +1198,6 @@ void QWaylandWindow::handleUpdate()
if (!mSurface)
return;
@ -54,5 +54,5 @@ index 85307875..c020a58f 100644
struct ::wl_surface *wrappedSurface = reinterpret_cast<struct ::wl_surface *>(wl_proxy_create_wrapper(mSurface->object()));
wl_proxy_set_queue(reinterpret_cast<wl_proxy *>(wrappedSurface), mFrameQueue.queue);
--
2.36.1
2.37.3

View File

@ -1,7 +1,7 @@
From 2ab9b543e24936b4950de6ee82336bc5ae99ef49 Mon Sep 17 00:00:00 2001
From 82f6e0525aa3bc14617d62847d4b3a153fe67a44 Mon Sep 17 00:00:00 2001
From: Rodney Dawes <dobey.pwns@gmail.com>
Date: Fri, 15 Oct 2021 12:55:33 -0400
Subject: [PATCH 14/39] Fix the logic for decoding modifiers map in Wayland
Subject: [PATCH 13/47] Fix the logic for decoding modifiers map in Wayland
text input protocol
Correctly check for the flags in the modifiers map when we get it from
@ -36,5 +36,5 @@ index 8b79c08f..84a34674 100644
return ret;
}
--
2.36.1
2.37.3

View File

@ -1,7 +1,7 @@
From 441ede1cd5a43b4cb580bb916e1d20ba583080ee Mon Sep 17 00:00:00 2001
From 63d06271d40e53ab27457d891e7811e5ba481973 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?M=C3=A9ven=20Car?= <meven.car@enioka.com>
Date: Wed, 18 Aug 2021 18:28:20 +0200
Subject: [PATCH 15/39] Wayland client: use wl_keyboard to determine active
Subject: [PATCH 14/47] Wayland client: use wl_keyboard to determine active
state
Commit f497a5bb87270174b8e0106b7eca1992d44ff15d made QWaylandDisplay
@ -95,7 +95,7 @@ index 3b092bc8..09a1736a 100644
void blockingReadEvents();
void flushRequests();
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp
index c020a58f..ba881cb3 100644
index afef6c0b..a14d8705 100644
--- a/src/client/qwaylandwindow.cpp
+++ b/src/client/qwaylandwindow.cpp
@@ -96,7 +96,6 @@ QWaylandWindow::QWaylandWindow(QWindow *window, QWaylandDisplay *display)
@ -115,7 +115,7 @@ index c020a58f..ba881cb3 100644
}
QWaylandWindow *QWaylandWindow::fromWlSurface(::wl_surface *surface)
@@ -1083,10 +1084,18 @@ bool QWaylandWindow::setMouseGrabEnabled(bool grab)
@@ -1098,10 +1099,18 @@ bool QWaylandWindow::setMouseGrabEnabled(bool grab)
return true;
}
@ -136,7 +136,7 @@ index c020a58f..ba881cb3 100644
}
diff --git a/src/client/qwaylandwindow_p.h b/src/client/qwaylandwindow_p.h
index 6cc1664b..e0687962 100644
index 01337cff..fb3ed606 100644
--- a/src/client/qwaylandwindow_p.h
+++ b/src/client/qwaylandwindow_p.h
@@ -148,6 +148,7 @@ public:
@ -337,5 +337,5 @@ index e2593314..73d1eb9c 100644
const QSize screenSize(640, 480);
const uint maximizedSerial = exec([=] {
--
2.36.1
2.37.3

View File

@ -1,7 +1,7 @@
From cc377a1dda41d4b668e2aa28b60788f026ef2b7b Mon Sep 17 00:00:00 2001
From 1505033c73fc89c4bd5e6c0add0b1025391024f8 Mon Sep 17 00:00:00 2001
From: Jan Grulich <jgrulich@redhat.com>
Date: Fri, 16 Jul 2021 13:00:03 +0200
Subject: [PATCH 16/39] Client: do not empty clipboard when a new popup/window
Subject: [PATCH 15/47] Client: do not empty clipboard when a new popup/window
is opened
If we open a new popup or a window within the same app we have to avoid
@ -64,5 +64,5 @@ index 613fe862..aaec7eb8 100644
mRepeatTimer.stop();
}
--
2.36.1
2.37.3

View File

@ -1,7 +1,7 @@
From 6c3e758f465642e2cb149ecac13e51cdad7c0365 Mon Sep 17 00:00:00 2001
From 8f6e1d59b5c0ae9999ec42d0499bb444d02860fd Mon Sep 17 00:00:00 2001
From: Weng Xuetian <wengxt@gmail.com>
Date: Sat, 18 Dec 2021 23:42:49 -0800
Subject: [PATCH 17/39] Set preedit cursor when cursor equals to 0
Subject: [PATCH 16/47] Set preedit cursor when cursor equals to 0
Pick-to: 6.3 6.2 5.15
Change-Id: I832fbb22d973b36ac4ab51570fc53bc2e4c3ed58
@ -25,5 +25,5 @@ index 526d0ef4..25be2509 100644
} else if (m_preeditCursor > 0) {
attributes.append(QInputMethodEvent::Attribute(QInputMethodEvent::Cursor, indexFromWayland(text, m_preeditCursor), 1, QVariant()));
--
2.36.1
2.37.3

View File

@ -1,7 +1,7 @@
From 0d8986264ed9b3697b7abb845f603f4a652b2ff3 Mon Sep 17 00:00:00 2001
From cfa528e05d93bec8630f23eac2f0aa17b02e3d62 Mon Sep 17 00:00:00 2001
From: David Edmundson <davidedmundson@kde.org>
Date: Tue, 16 Feb 2021 09:51:47 +0000
Subject: [PATCH 18/39] Client: Implement DataDeviceV3
Subject: [PATCH 17/47] Client: Implement DataDeviceV3
DataDeviceV2 fixes a leak of DataDevice resources.
@ -509,5 +509,5 @@ index 1568b3b9..067410d0 100644
class DataDeviceCompositor : public DefaultCompositor {
public:
--
2.36.1
2.37.3

View File

@ -1,7 +1,7 @@
From 8c77607a4802eda5e108fedcdff392040266649c Mon Sep 17 00:00:00 2001
From e8204cd4701ed59cc3fb3d025ec17ff8001d38b5 Mon Sep 17 00:00:00 2001
From: Arjen Hiemstra <ahiemstra@heimr.nl>
Date: Thu, 18 Nov 2021 13:05:30 +0100
Subject: [PATCH 19/39] Client: Delay deletion of QDrag object until after
Subject: [PATCH 18/47] Client: Delay deletion of QDrag object until after
we're done with it
In certain cases, most notably when performing drag and drop operations
@ -63,5 +63,5 @@ index 747f0190..46f629ac 100644
private:
QWaylandDisplay *m_display = nullptr;
--
2.36.1
2.37.3

View File

@ -1,7 +1,7 @@
From 67bad0273b36497269969d0f64635d918e4ce985 Mon Sep 17 00:00:00 2001
From d9324566b1c47a9feada7c10105a5cefb49f8683 Mon Sep 17 00:00:00 2001
From: David Edmundson <davidedmundson@kde.org>
Date: Sun, 14 Nov 2021 13:54:19 +0000
Subject: [PATCH 20/39] Client: Avoid processing of events when showing windows
Subject: [PATCH 19/47] Client: Avoid processing of events when showing windows
The only time we want to dispatch events from the wayland socket is when
the application is waiting for external events. Doing so at any other
@ -22,10 +22,10 @@ Reviewed-by: Aleix Pol Gonzalez <aleixpol@kde.org>
1 file changed, 1 deletion(-)
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp
index ba881cb3..1597f67e 100644
index a14d8705..33c5b9d3 100644
--- a/src/client/qwaylandwindow.cpp
+++ b/src/client/qwaylandwindow.cpp
@@ -436,7 +436,6 @@ void QWaylandWindow::setVisible(bool visible)
@@ -437,7 +437,6 @@ void QWaylandWindow::setVisible(bool visible)
if (window()->type() == Qt::Popup || window()->type() == Qt::ToolTip)
activePopups << this;
initWindow();
@ -34,5 +34,5 @@ index ba881cb3..1597f67e 100644
setGeometry(windowGeometry());
// Don't flush the events here, or else the newly visible window may start drawing, but since
--
2.36.1
2.37.3

View File

@ -1,7 +1,7 @@
From 3e47c6b3f58772b2009ef6b1c71a82f387f6a648 Mon Sep 17 00:00:00 2001
From 746a5262b53fddb3cebd4accbe82844f9ee6a2f9 Mon Sep 17 00:00:00 2001
From: Elvis Lee <kwangwoong.lee@lge.com>
Date: Thu, 18 Feb 2021 15:45:49 +0900
Subject: [PATCH 21/39] Handle registry_global out of constructor
Subject: [PATCH 20/47] Handle registry_global out of constructor
Factory functions in QWaylandDisplay::registry_global() can be overridden.
Later, other classes instantiated in the registry_global can support
@ -81,5 +81,5 @@ index e5e7dd42..f5632982 100644
mDisplay->ensureScreen();
}
--
2.36.1
2.37.3

View File

@ -1,7 +1,7 @@
From ec6027f0c9b15cd23d7a7b52235b1e39413cf835 Mon Sep 17 00:00:00 2001
From cd253857f2ca0f1f90e001df5bb40b4967a734da Mon Sep 17 00:00:00 2001
From: Elvis Lee <kwangwoong.lee@lge.com>
Date: Wed, 17 Mar 2021 16:31:10 +0900
Subject: [PATCH 22/39] Connect flushRequest after forceRoundTrip
Subject: [PATCH 21/47] Connect flushRequest after forceRoundTrip
If flushRequest is connected with aboutToBlock, the flushRequest
may consumes all events so that processEvents might be blocked in forceRoundTrip.
@ -43,5 +43,5 @@ index f5632982..3a6fa651 100644
mDisplay->ensureScreen();
}
--
2.36.1
2.37.3

View File

@ -1,7 +1,7 @@
From ca8ebd4833a8f040f52e14b007d7eb3ecd6b0371 Mon Sep 17 00:00:00 2001
From cb887d58bdf4f685f0a1f226bfbc3b2806d8ca17 Mon Sep 17 00:00:00 2001
From: Adrien Faveraux <af@brain-networks.fr>
Date: Fri, 26 Nov 2021 09:18:58 +0100
Subject: [PATCH 23/39] Move the wayland socket polling to a separate event
Subject: [PATCH 22/47] Move the wayland socket polling to a separate event
thread
New event threads is introduced which calls poll() on the wayland fd,
@ -458,7 +458,7 @@ index 3a6fa651..3b876047 100644
// Call after eventDispatcher is fully connected, for QWaylandDisplay::forceRoundTrip()
mDisplay->initialize();
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp
index 1597f67e..7de19a74 100644
index 33c5b9d3..2c4ffb56 100644
--- a/src/client/qwaylandwindow.cpp
+++ b/src/client/qwaylandwindow.cpp
@@ -76,7 +76,6 @@ QWaylandWindow *QWaylandWindow::mMouseGrab = nullptr;
@ -478,7 +478,7 @@ index 1597f67e..7de19a74 100644
delete mWindowDecoration;
if (mSurface)
@@ -635,6 +632,8 @@ const wl_callback_listener QWaylandWindow::callbackListener = {
@@ -648,6 +645,8 @@ const wl_callback_listener QWaylandWindow::callbackListener = {
void QWaylandWindow::handleFrameCallback()
{
@ -487,7 +487,7 @@ index 1597f67e..7de19a74 100644
mWaitingForFrameCallback = false;
mFrameCallbackElapsedTimer.invalidate();
@@ -656,12 +655,16 @@ void QWaylandWindow::handleFrameCallback()
@@ -669,12 +668,16 @@ void QWaylandWindow::handleFrameCallback()
mWaitingForUpdateDelivery = true;
QMetaObject::invokeMethod(this, doHandleExpose, Qt::QueuedConnection);
}
@ -506,7 +506,7 @@ index 1597f67e..7de19a74 100644
if (mWaitingForFrameCallback) {
qCDebug(lcWaylandBackingstore) << "Didn't receive frame callback in time, window should now be inexposed";
@@ -1157,8 +1160,11 @@ void QWaylandWindow::requestUpdate()
@@ -1172,8 +1175,11 @@ void QWaylandWindow::requestUpdate()
Q_ASSERT(hasPendingUpdateRequest()); // should be set by QPA
// If we have a frame callback all is good and will be taken care of there
@ -520,7 +520,7 @@ index 1597f67e..7de19a74 100644
// If we've already called deliverUpdateRequest(), but haven't seen any attach+commit/swap yet
// This is a somewhat redundant behavior and might indicate a bug in the calling code, so log
@@ -1171,7 +1177,12 @@ void QWaylandWindow::requestUpdate()
@@ -1186,7 +1192,12 @@ void QWaylandWindow::requestUpdate()
// so use invokeMethod to delay the delivery a bit.
QMetaObject::invokeMethod(this, [this] {
// Things might have changed in the meantime
@ -534,7 +534,7 @@ index 1597f67e..7de19a74 100644
deliverUpdateRequest();
}, Qt::QueuedConnection);
}
@@ -1191,9 +1202,10 @@ void QWaylandWindow::handleUpdate()
@@ -1206,9 +1217,10 @@ void QWaylandWindow::handleUpdate()
if (!mSurface)
return;
@ -547,7 +547,7 @@ index 1597f67e..7de19a74 100644
mFrameCallback = wl_surface_frame(wrappedSurface);
wl_proxy_wrapper_destroy(wrappedSurface);
wl_callback_add_listener(mFrameCallback, &QWaylandWindow::callbackListener, this);
@@ -1203,6 +1215,8 @@ void QWaylandWindow::handleUpdate()
@@ -1218,6 +1230,8 @@ void QWaylandWindow::handleUpdate()
// Start a timer for handling the case when the compositor stops sending frame callbacks.
if (mFrameCallbackTimeout > 0) {
QMetaObject::invokeMethod(this, [this] {
@ -557,7 +557,7 @@ index 1597f67e..7de19a74 100644
if (mFrameCallbackCheckIntervalTimerId < 0)
mFrameCallbackCheckIntervalTimerId = startTimer(mFrameCallbackTimeout);
diff --git a/src/client/qwaylandwindow_p.h b/src/client/qwaylandwindow_p.h
index e0687962..d45980a8 100644
index fb3ed606..54ac67a9 100644
--- a/src/client/qwaylandwindow_p.h
+++ b/src/client/qwaylandwindow_p.h
@@ -232,7 +232,7 @@ protected:
@ -570,5 +570,5 @@ index e0687962..d45980a8 100644
// True when we have called deliverRequestUpdate, but the client has not yet attached a new buffer
--
2.36.1
2.37.3

View File

@ -1,7 +1,7 @@
From a840317f050be717cf87e740a0201caf1c8b115d Mon Sep 17 00:00:00 2001
From 1480fda6ab4a23debd2d1a75d0e8f6c851255441 Mon Sep 17 00:00:00 2001
From: Inho Lee <inho.lee@qt.io>
Date: Mon, 1 Nov 2021 14:23:58 +0100
Subject: [PATCH 25/39] Do not create decorations when the shellSurface is not
Subject: [PATCH 23/47] Do not create decorations when the shellSurface is not
ready
A cases reported that client windows try to make decorations
@ -22,10 +22,10 @@ Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp
index ac01dc05..acfe390e 100644
index 2c4ffb56..13976320 100644
--- a/src/client/qwaylandwindow.cpp
+++ b/src/client/qwaylandwindow.cpp
@@ -813,7 +813,7 @@ bool QWaylandWindow::createDecoration()
@@ -828,7 +828,7 @@ bool QWaylandWindow::createDecoration()
decoration = false;
if (mSubSurfaceWindow)
decoration = false;
@ -35,5 +35,5 @@ index ac01dc05..acfe390e 100644
bool hadDecoration = mWindowDecoration;
--
2.36.1
2.37.3

View File

@ -1,7 +1,7 @@
From e9983ba23399ed03437d0f98e063896aa222c519 Mon Sep 17 00:00:00 2001
From fccba4c2f4ba10cfa823c5a17d739618e52ce309 Mon Sep 17 00:00:00 2001
From: Joni Poikelin <joni.poikelin@qt.io>
Date: Thu, 3 Feb 2022 14:01:50 +0200
Subject: [PATCH 27/39] Fix crash if no input method module could be loaded
Subject: [PATCH 24/47] Fix crash if no input method module could be loaded
Pick-to: 6.2 6.3 5.15
Change-Id: I8f346def616606a6c5540856bd08a84ee7ed5ca2
@ -25,5 +25,5 @@ index 3b876047..fbf00c6b 100644
QWaylandShellIntegration *QWaylandIntegration::createShellIntegration(const QString &integrationName)
--
2.36.1
2.37.3

View File

@ -1,7 +1,7 @@
From ba8b58d4549c89f80c9ab914ec6024977c56c530 Mon Sep 17 00:00:00 2001
From d45289232b887bad6157bb53caaa8244ee4df9e1 Mon Sep 17 00:00:00 2001
From: Vlad Zahorodnii <vlad.zahorodnii@kde.org>
Date: Tue, 1 Feb 2022 13:05:36 +0200
Subject: [PATCH 28/39] Client: Remove mWaitingForUpdateDelivery
Subject: [PATCH 25/47] Client: Remove mWaitingForUpdateDelivery
Currently, mWaitingForUpdateDelivery is shared between the main thread
(doHandleFrameCallback()) and the frame callback event thread
@ -23,10 +23,10 @@ Reviewed-by: David Edmundson <davidedmundson@kde.org>
2 files changed, 12 insertions(+), 18 deletions(-)
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp
index 4c5711a0..949374b1 100644
index 13976320..579a762a 100644
--- a/src/client/qwaylandwindow.cpp
+++ b/src/client/qwaylandwindow.cpp
@@ -648,23 +648,18 @@ void QWaylandWindow::handleFrameCallback()
@@ -651,23 +651,18 @@ void QWaylandWindow::handleFrameCallback()
mFrameCallbackElapsedTimer.invalidate();
// The rest can wait until we can run it on the correct thread
@ -63,7 +63,7 @@ index 4c5711a0..949374b1 100644
mFrameSyncWait.notify_all();
}
diff --git a/src/client/qwaylandwindow_p.h b/src/client/qwaylandwindow_p.h
index d45980a8..3ff68ccb 100644
index 54ac67a9..cf7ce879 100644
--- a/src/client/qwaylandwindow_p.h
+++ b/src/client/qwaylandwindow_p.h
@@ -228,7 +228,6 @@ protected:
@ -75,5 +75,5 @@ index d45980a8..3ff68ccb 100644
QElapsedTimer mFrameCallbackElapsedTimer;
struct ::wl_callback *mFrameCallback = nullptr;
--
2.36.1
2.37.3

View File

@ -1,7 +1,7 @@
From a94d4c85fd8a969e93be836dd9d6829c5ca64347 Mon Sep 17 00:00:00 2001
From 52f134c18cf8f6bdf91716cb917ef7e5e7314fd1 Mon Sep 17 00:00:00 2001
From: Weng Xuetian <wengxt@gmail.com>
Date: Tue, 8 Feb 2022 07:11:25 -0800
Subject: [PATCH 29/39] Cursor position == 0 should still show the cursor
Subject: [PATCH 26/47] Cursor position == 0 should still show the cursor
Otherwise the cursor would be hidden even if preedit is empty.
Amends 719a55be13bdadfa659a732755f280e276a894bd
@ -31,5 +31,5 @@ index 25be2509..458d818e 100644
}
--
2.36.1
2.37.3

View File

@ -1,7 +1,7 @@
From f6989471da98d774e106462d73d7c055cffa8280 Mon Sep 17 00:00:00 2001
From c617e5a182bbffb58b36604d530be11d2b0e9e2c Mon Sep 17 00:00:00 2001
From: Weng Xuetian <wengxt@gmail.com>
Date: Wed, 22 Dec 2021 10:42:38 -0800
Subject: [PATCH 30/39] Update the preedit styling mapping
Subject: [PATCH 27/47] Update the preedit styling mapping
- None mapping to no style.
- Default/Underline mapping to underline.
@ -84,5 +84,5 @@ index 458d818e..f50ccf30 100644
break;
}
--
2.36.1
2.37.3

View File

@ -1,7 +1,7 @@
From a3a6f5258c61f41d4f2ba69386ae6f0f21e096db Mon Sep 17 00:00:00 2001
From 854a2a206357fec346e76c54e97ae462eeb5daa4 Mon Sep 17 00:00:00 2001
From: David Edmundson <davidedmundson@kde.org>
Date: Wed, 9 Feb 2022 17:20:48 +0000
Subject: [PATCH 31/39] client: Simplify round trip behavior
Subject: [PATCH 28/47] client: Simplify round trip behavior
The custom event queue was removed in
302d4ffb8549214eb4028dc3e47ec4ee4e12ffbd (2015) so the comment about not
@ -22,7 +22,7 @@ Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
1 file changed, 1 insertion(+), 42 deletions(-)
diff --git a/src/client/qwaylanddisplay.cpp b/src/client/qwaylanddisplay.cpp
index 6f1bada5..86045a35 100644
index a7ce280a..41a44e4b 100644
--- a/src/client/qwaylanddisplay.cpp
+++ b/src/client/qwaylanddisplay.cpp
@@ -611,50 +611,9 @@ uint32_t QWaylandDisplay::currentTimeMillisec()
@ -78,5 +78,5 @@ index 6f1bada5..86045a35 100644
bool QWaylandDisplay::supportsWindowDecoration() const
--
2.36.1
2.37.3

View File

@ -1,7 +1,7 @@
From a88efdaa9aa2ee7e5ce3cdb157ce4b52a18933a0 Mon Sep 17 00:00:00 2001
From 2b2905a859304e2c184a7b2a76b9e4b13f6d210c Mon Sep 17 00:00:00 2001
From: Vlad Zahorodnii <vlad.zahorodnii@kde.org>
Date: Sat, 19 Feb 2022 17:01:04 +0200
Subject: [PATCH 32/39] Client: Fix opaque region setter
Subject: [PATCH 29/47] Client: Fix opaque region setter
The rect is in the global coordinate system, while the opaque region
must be in the surface local coordinate system.
@ -14,7 +14,7 @@ Reviewed-by: Aleix Pol Gonzalez <aleixpol@kde.org>
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp
index 949374b1..fee2ecdd 100644
index 579a762a..694e98a4 100644
--- a/src/client/qwaylandwindow.cpp
+++ b/src/client/qwaylandwindow.cpp
@@ -372,7 +372,7 @@ void QWaylandWindow::setGeometry(const QRect &rect)
@ -27,5 +27,5 @@ index 949374b1..fee2ecdd 100644
void QWaylandWindow::resizeFromApplyConfigure(const QSize &sizeWithMargins, const QPoint &offset)
--
2.36.1
2.37.3

View File

@ -1,7 +1,7 @@
From ea6c72c442a9f91cbdd5546530737fb5715aab83 Mon Sep 17 00:00:00 2001
From d2bd1cda1ac12e19d57985aee412fc2bd67b49b8 Mon Sep 17 00:00:00 2001
From: Fabian Vogt <fabian@ritter-vogt.de>
Date: Fri, 4 Feb 2022 11:07:36 +0100
Subject: [PATCH 33/39] Use proper dependencies in compile tests
Subject: [PATCH 30/47] Use proper dependencies in compile tests
Use the dependencies as found by the "libraries" section instead of relying
on them being available in the default location (e.g. "-ldrm").
@ -122,5 +122,5 @@ index bcfd5215..da95d07b 100644
},
--
2.36.1
2.37.3

View File

@ -1,7 +1,7 @@
From b806f16d0508d52009d77884bd7cd2f377bce6bb Mon Sep 17 00:00:00 2001
From 2222b675fc1ce754f0e5f9fd212ba0b274dc2599 Mon Sep 17 00:00:00 2001
From: Liang Qi <liang.qi@qt.io>
Date: Wed, 9 Mar 2022 10:47:42 +0100
Subject: [PATCH 34/39] client: update button state and etc in pointer_leave()
Subject: [PATCH 31/47] client: update button state and etc in pointer_leave()
The cleanup work needs to be done even the surface is null, for
example, a window was closed in mouse press handler, then will not
@ -46,5 +46,5 @@ index aaec7eb8..c3cc4eca 100644
class MotionEvent : public QWaylandPointerEvent
--
2.36.1
2.37.3

View File

@ -1,7 +1,7 @@
From 91ecab964af85adc2ad7998a2f7c38f89b67c07a Mon Sep 17 00:00:00 2001
From 29a5701dd1ac110af8a2b20a92fd1e09f8299861 Mon Sep 17 00:00:00 2001
From: Paul Olav Tvete <paul.tvete@qt.io>
Date: Tue, 15 Mar 2022 15:59:15 +0100
Subject: [PATCH 35/39] Revert "Client: Remove mWaitingForUpdateDelivery"
Subject: [PATCH 32/47] Revert "Client: Remove mWaitingForUpdateDelivery"
The reverted commit introduces a severe performance regression
when a client window is resized while a QtQuick renderthread
@ -18,10 +18,10 @@ Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp
index fee2ecdd..bf41cc5b 100644
index 694e98a4..733d5ffa 100644
--- a/src/client/qwaylandwindow.cpp
+++ b/src/client/qwaylandwindow.cpp
@@ -655,11 +655,17 @@ void QWaylandWindow::handleFrameCallback()
@@ -658,11 +658,17 @@ void QWaylandWindow::handleFrameCallback()
sendExposeEvent(QRect(QPoint(), geometry().size()));
if (wasExposed && hasPendingUpdateRequest())
deliverUpdateRequest();
@ -43,7 +43,7 @@ index fee2ecdd..bf41cc5b 100644
mFrameSyncWait.notify_all();
}
diff --git a/src/client/qwaylandwindow_p.h b/src/client/qwaylandwindow_p.h
index 3ff68ccb..d45980a8 100644
index cf7ce879..54ac67a9 100644
--- a/src/client/qwaylandwindow_p.h
+++ b/src/client/qwaylandwindow_p.h
@@ -228,6 +228,7 @@ protected:
@ -55,5 +55,5 @@ index 3ff68ccb..d45980a8 100644
QElapsedTimer mFrameCallbackElapsedTimer;
struct ::wl_callback *mFrameCallback = nullptr;
--
2.36.1
2.37.3

View File

@ -1,7 +1,7 @@
From 72c608846ccb39a542d598d7b87ab709f38b969d Mon Sep 17 00:00:00 2001
From f1a4832a2db60af2110ffe4cdf9589cc06da4f59 Mon Sep 17 00:00:00 2001
From: Paul Olav Tvete <paul.tvete@qt.io>
Date: Tue, 15 Mar 2022 16:53:04 +0100
Subject: [PATCH 36/39] Fix race condition on mWaitingForUpdateDelivery
Subject: [PATCH 33/47] Fix race condition on mWaitingForUpdateDelivery
Change-Id: I0e91bda73722468b9339fc434fe04420b5e7d3da
Reviewed-by: David Edmundson <davidedmundson@kde.org>
@ -11,10 +11,10 @@ Reviewed-by: David Edmundson <davidedmundson@kde.org>
2 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp
index bf41cc5b..ceaa4c73 100644
index 733d5ffa..1952c81e 100644
--- a/src/client/qwaylandwindow.cpp
+++ b/src/client/qwaylandwindow.cpp
@@ -649,24 +649,21 @@ void QWaylandWindow::handleFrameCallback()
@@ -652,24 +652,21 @@ void QWaylandWindow::handleFrameCallback()
// The rest can wait until we can run it on the correct thread
auto doHandleExpose = [this]() {
@ -42,7 +42,7 @@ index bf41cc5b..ceaa4c73 100644
}
diff --git a/src/client/qwaylandwindow_p.h b/src/client/qwaylandwindow_p.h
index d45980a8..cb9135f6 100644
index 54ac67a9..c0a76345 100644
--- a/src/client/qwaylandwindow_p.h
+++ b/src/client/qwaylandwindow_p.h
@@ -228,7 +228,7 @@ protected:
@ -55,5 +55,5 @@ index d45980a8..cb9135f6 100644
QElapsedTimer mFrameCallbackElapsedTimer;
struct ::wl_callback *mFrameCallback = nullptr;
--
2.36.1
2.37.3

View File

@ -1,7 +1,7 @@
From c9a24980b67a96c62e31eade65a254131fbef51d Mon Sep 17 00:00:00 2001
From 2d44b41a314ac18e000fff23c8a21f8de76a8a80 Mon Sep 17 00:00:00 2001
From: Kenneth Topp <ken@bllue.org>
Date: Mon, 4 Apr 2022 09:36:21 -0400
Subject: [PATCH 37/39] use poll(2) when reading from clipboard
Subject: [PATCH 34/47] use poll(2) when reading from clipboard
change clipboard read away from select(2) call which can fail when
an application has large number of open files
@ -44,5 +44,5 @@ index c9e158cc..fe0ea8c9 100644
} else if (ready == 0) {
qWarning("QWaylandDataOffer: timeout reading from pipe");
--
2.36.1
2.37.3

View File

@ -1,7 +1,7 @@
From 1e58585693eb337fc1c80e10987ed27115255d97 Mon Sep 17 00:00:00 2001
From fdc18ecd3674fa026e090a68ae869d2696bf6d8a Mon Sep 17 00:00:00 2001
From: Ulf Hermann <ulf.hermann@qt.io>
Date: Tue, 22 Feb 2022 12:31:08 +0100
Subject: [PATCH 38/39] Reduce memory leakage
Subject: [PATCH 35/47] Reduce memory leakage
We need to clean up the event queue when we're done.
@ -13,7 +13,7 @@ Reviewed-by: David Edmundson <davidedmundson@kde.org>
1 file changed, 3 insertions(+)
diff --git a/src/client/qwaylanddisplay.cpp b/src/client/qwaylanddisplay.cpp
index 86045a35..e8613ed8 100644
index 41a44e4b..622ffe41 100644
--- a/src/client/qwaylanddisplay.cpp
+++ b/src/client/qwaylanddisplay.cpp
@@ -379,6 +379,9 @@ QWaylandDisplay::~QWaylandDisplay(void)
@ -27,5 +27,5 @@ index 86045a35..e8613ed8 100644
// Steps which is called just after constructor. This separates registry_global() out of the constructor
--
2.36.1
2.37.3

View File

@ -1,7 +1,7 @@
From 64fa557eb30fc1219bec50a45107ea1a983411ed Mon Sep 17 00:00:00 2001
From cb205112b141e48c5a2251f5424be3a99baafad5 Mon Sep 17 00:00:00 2001
From: Sam James <sam@gentoo.org>
Date: Sat, 18 Jun 2022 17:11:11 +0100
Subject: [PATCH 39/39] Fix build with libcxx (missing array include)
Subject: [PATCH 36/47] Fix build with libcxx (missing array include)
Bug: https://bugs.gentoo.org/833488
@ -28,5 +28,5 @@ index 56a710c3..c6a8b6c6 100644
#include <EGL/eglext.h>
--
2.36.1
2.37.3

View File

@ -0,0 +1,401 @@
From 6df6ff51718eda0f06c2df6edb22e8a4fc9c353e Mon Sep 17 00:00:00 2001
From: Weng Xuetian <wengxt@gmail.com>
Date: Wed, 20 Jul 2022 15:57:40 -0700
Subject: [PATCH 37/47] Only close popup in the the hierchary
Imagine following event sequences:
1. a tooltip is shown. activePopups = {tooltip}
2. user click menu bar to show the menu, QMenu::setVisible is called.
now activePopups(tooltip, menu}
3. tooltip visibility changed to false.
4. closePopups() close both tooltip and menu.
This is a common pattern under wayland that menu is shown as a invisible
state. This patch tries to memorize the surface hierchary used to create
the popup role. And only close those popups whose ancesotor is hidden.
Pick-to: 6.4
Change-Id: I78aa0b4e32a5812603e003e756d8bcd202e94af4
Reviewed-by: David Edmundson <davidedmundson@kde.org>
(cherry picked from commit f8e3257e9b1e22d52e9c221c62b8d9b6dd1151a3)
---
src/client/qwaylandwindow.cpp | 33 ++++---
src/client/qwaylandwindow_p.h | 6 ++
.../xdg-shell-v5/qwaylandxdgpopupv5.cpp | 5 +-
.../xdg-shell-v5/qwaylandxdgpopupv5_p.h | 3 +-
.../xdg-shell-v5/qwaylandxdgshellv5.cpp | 2 +-
.../xdg-shell-v6/qwaylandxdgshellv6.cpp | 3 +
.../xdg-shell/qwaylandxdgshell.cpp | 22 +++--
.../xdg-shell/qwaylandxdgshell_p.h | 5 +-
tests/auto/client/xdgshell/tst_xdgshell.cpp | 87 +++++++++++++++++++
9 files changed, 136 insertions(+), 30 deletions(-)
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp
index 1952c81e..6923c9a7 100644
--- a/src/client/qwaylandwindow.cpp
+++ b/src/client/qwaylandwindow.cpp
@@ -239,6 +239,7 @@ bool QWaylandWindow::shouldCreateSubSurface() const
void QWaylandWindow::reset()
{
+ closeChildPopups();
delete mShellSurface;
mShellSurface = nullptr;
delete mSubSurfaceWindow;
@@ -397,21 +398,6 @@ void QWaylandWindow::sendExposeEvent(const QRect &rect)
mLastExposeGeometry = rect;
}
-
-static QVector<QPointer<QWaylandWindow>> activePopups;
-
-void QWaylandWindow::closePopups(QWaylandWindow *parent)
-{
- while (!activePopups.isEmpty()) {
- auto popup = activePopups.takeLast();
- if (popup.isNull())
- continue;
- if (popup.data() == parent)
- return;
- popup->reset();
- }
-}
-
QPlatformScreen *QWaylandWindow::calculateScreenFromSurfaceEvents() const
{
QReadLocker lock(&mSurfaceLock);
@@ -431,8 +417,6 @@ void QWaylandWindow::setVisible(bool visible)
lastVisible = visible;
if (visible) {
- if (window()->type() == Qt::Popup || window()->type() == Qt::ToolTip)
- activePopups << this;
initWindow();
setGeometry(windowGeometry());
@@ -441,7 +425,6 @@ void QWaylandWindow::setVisible(bool visible)
// QWaylandShmBackingStore::beginPaint().
} else {
sendExposeEvent(QRect());
- closePopups(this);
reset();
}
}
@@ -1290,6 +1273,20 @@ void QWaylandWindow::setOpaqueArea(const QRegion &opaqueArea)
wl_region_destroy(region);
}
+void QWaylandWindow::addChildPopup(QWaylandWindow *surface) {
+ mChildPopups.append(surface);
+}
+
+void QWaylandWindow::removeChildPopup(QWaylandWindow *surface) {
+ mChildPopups.removeAll(surface);
+}
+
+void QWaylandWindow::closeChildPopups() {
+ while (!mChildPopups.isEmpty()) {
+ auto popup = mChildPopups.takeLast();
+ popup->reset();
+ }
+}
}
QT_END_NAMESPACE
diff --git a/src/client/qwaylandwindow_p.h b/src/client/qwaylandwindow_p.h
index c0a76345..2be87bc0 100644
--- a/src/client/qwaylandwindow_p.h
+++ b/src/client/qwaylandwindow_p.h
@@ -207,6 +207,10 @@ public:
void handleUpdate();
void deliverUpdateRequest() override;
+ void addChildPopup(QWaylandWindow* child);
+ void removeChildPopup(QWaylandWindow* child);
+ void closeChildPopups();
+
public slots:
void applyConfigure();
@@ -262,6 +266,8 @@ protected:
QWaylandBuffer *mQueuedBuffer = nullptr;
QRegion mQueuedBufferDamage;
+ QList<QPointer<QWaylandWindow>> mChildPopups;
+
private:
void setGeometry_helper(const QRect &rect);
void initWindow();
diff --git a/src/plugins/shellintegration/xdg-shell-v5/qwaylandxdgpopupv5.cpp b/src/plugins/shellintegration/xdg-shell-v5/qwaylandxdgpopupv5.cpp
index 85d25e3c..60bdd491 100644
--- a/src/plugins/shellintegration/xdg-shell-v5/qwaylandxdgpopupv5.cpp
+++ b/src/plugins/shellintegration/xdg-shell-v5/qwaylandxdgpopupv5.cpp
@@ -47,18 +47,21 @@ QT_BEGIN_NAMESPACE
namespace QtWaylandClient {
-QWaylandXdgPopupV5::QWaylandXdgPopupV5(struct ::xdg_popup_v5 *popup, QWaylandWindow *window)
+QWaylandXdgPopupV5::QWaylandXdgPopupV5(struct ::xdg_popup_v5 *popup, QWaylandWindow* parent, QWaylandWindow *window)
: QWaylandShellSurface(window)
, QtWayland::xdg_popup_v5(popup)
+ , m_parent(parent)
, m_window(window)
{
if (window->display()->windowExtension())
m_extendedWindow = new QWaylandExtendedSurface(window);
+ m_parent->addChildPopup(m_window);
}
QWaylandXdgPopupV5::~QWaylandXdgPopupV5()
{
xdg_popup_destroy(object());
+ m_parent->removeChildPopup(m_window);
delete m_extendedWindow;
}
diff --git a/src/plugins/shellintegration/xdg-shell-v5/qwaylandxdgpopupv5_p.h b/src/plugins/shellintegration/xdg-shell-v5/qwaylandxdgpopupv5_p.h
index 7494f6a6..d85f130b 100644
--- a/src/plugins/shellintegration/xdg-shell-v5/qwaylandxdgpopupv5_p.h
+++ b/src/plugins/shellintegration/xdg-shell-v5/qwaylandxdgpopupv5_p.h
@@ -70,7 +70,7 @@ class Q_WAYLAND_CLIENT_EXPORT QWaylandXdgPopupV5 : public QWaylandShellSurface
{
Q_OBJECT
public:
- QWaylandXdgPopupV5(struct ::xdg_popup_v5 *popup, QWaylandWindow *window);
+ QWaylandXdgPopupV5(struct ::xdg_popup_v5 *popup, QWaylandWindow* parent, QWaylandWindow *window);
~QWaylandXdgPopupV5() override;
protected:
@@ -78,6 +78,7 @@ protected:
private:
QWaylandExtendedSurface *m_extendedWindow = nullptr;
+ QWaylandWindow *m_parent = nullptr;
QWaylandWindow *m_window = nullptr;
};
diff --git a/src/plugins/shellintegration/xdg-shell-v5/qwaylandxdgshellv5.cpp b/src/plugins/shellintegration/xdg-shell-v5/qwaylandxdgshellv5.cpp
index 7e242c4a..def8452a 100644
--- a/src/plugins/shellintegration/xdg-shell-v5/qwaylandxdgshellv5.cpp
+++ b/src/plugins/shellintegration/xdg-shell-v5/qwaylandxdgshellv5.cpp
@@ -84,7 +84,7 @@ QWaylandXdgPopupV5 *QWaylandXdgShellV5::createXdgPopup(QWaylandWindow *window, Q
int x = position.x() + parentWindow->frameMargins().left();
int y = position.y() + parentWindow->frameMargins().top();
- auto popup = new QWaylandXdgPopupV5(get_xdg_popup(window->wlSurface(), parentSurface, seat, m_popupSerial, x, y), window);
+ auto popup = new QWaylandXdgPopupV5(get_xdg_popup(window->wlSurface(), parentSurface, seat, m_popupSerial, x, y), parentWindow, window);
m_popups.append(window);
QObject::connect(popup, &QWaylandXdgPopupV5::destroyed, [this, window](){
m_popups.removeOne(window);
diff --git a/src/plugins/shellintegration/xdg-shell-v6/qwaylandxdgshellv6.cpp b/src/plugins/shellintegration/xdg-shell-v6/qwaylandxdgshellv6.cpp
index 8c371661..151c78e3 100644
--- a/src/plugins/shellintegration/xdg-shell-v6/qwaylandxdgshellv6.cpp
+++ b/src/plugins/shellintegration/xdg-shell-v6/qwaylandxdgshellv6.cpp
@@ -174,6 +174,7 @@ QWaylandXdgSurfaceV6::Popup::Popup(QWaylandXdgSurfaceV6 *xdgSurface, QWaylandXdg
, m_xdgSurface(xdgSurface)
, m_parent(parent)
{
+ m_parent->window()->addChildPopup(m_xdgSurface->window());
}
QWaylandXdgSurfaceV6::Popup::~Popup()
@@ -181,6 +182,8 @@ QWaylandXdgSurfaceV6::Popup::~Popup()
if (isInitialized())
destroy();
+ m_parent->window()->removeChildPopup(m_xdgSurface->window());
+
if (m_grabbing) {
auto *shell = m_xdgSurface->m_shell;
Q_ASSERT(shell->m_topmostGrabbingPopup == this);
diff --git a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp
index d7d0ddf7..3999a5ee 100644
--- a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp
+++ b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp
@@ -195,12 +195,17 @@ QtWayland::xdg_toplevel::resize_edge QWaylandXdgSurface::Toplevel::convertToResi
| ((edges & Qt::RightEdge) ? resize_edge_right : 0));
}
-QWaylandXdgSurface::Popup::Popup(QWaylandXdgSurface *xdgSurface, QWaylandXdgSurface *parent,
+QWaylandXdgSurface::Popup::Popup(QWaylandXdgSurface *xdgSurface, QWaylandWindow *parent,
QtWayland::xdg_positioner *positioner)
- : xdg_popup(xdgSurface->get_popup(parent->object(), positioner->object()))
- , m_xdgSurface(xdgSurface)
+ : m_xdgSurface(xdgSurface)
+ , m_parentXdgSurface(qobject_cast<QWaylandXdgSurface *>(parent->shellSurface()))
, m_parent(parent)
{
+
+ init(xdgSurface->get_popup(m_parentXdgSurface ? m_parentXdgSurface->object() : nullptr, positioner->object()));
+ if (m_parent) {
+ m_parent->addChildPopup(m_xdgSurface->window());
+ }
}
QWaylandXdgSurface::Popup::~Popup()
@@ -208,10 +213,14 @@ QWaylandXdgSurface::Popup::~Popup()
if (isInitialized())
destroy();
+ if (m_parent) {
+ m_parent->removeChildPopup(m_xdgSurface->window());
+ }
+
if (m_grabbing) {
auto *shell = m_xdgSurface->m_shell;
Q_ASSERT(shell->m_topmostGrabbingPopup == this);
- shell->m_topmostGrabbingPopup = m_parent->m_popup;
+ shell->m_topmostGrabbingPopup = m_parentXdgSurface ? m_parentXdgSurface->m_popup : nullptr;
}
}
@@ -392,8 +401,6 @@ void QWaylandXdgSurface::setPopup(QWaylandWindow *parent)
{
Q_ASSERT(!m_toplevel && !m_popup);
- auto parentXdgSurface = static_cast<QWaylandXdgSurface *>(parent->shellSurface());
-
auto positioner = new QtWayland::xdg_positioner(m_shell->create_positioner());
// set_popup expects a position relative to the parent
QPoint transientPos = m_window->geometry().topLeft(); // this is absolute
@@ -406,8 +413,9 @@ void QWaylandXdgSurface::setPopup(QWaylandWindow *parent)
positioner->set_anchor(QtWayland::xdg_positioner::anchor_top_left);
positioner->set_gravity(QtWayland::xdg_positioner::gravity_bottom_right);
positioner->set_size(m_window->geometry().width(), m_window->geometry().height());
- m_popup = new Popup(this, parentXdgSurface, positioner);
+ m_popup = new Popup(this, parent, positioner);
positioner->destroy();
+
delete positioner;
}
diff --git a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell_p.h b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell_p.h
index 0c98be35..28ff76ba 100644
--- a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell_p.h
+++ b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell_p.h
@@ -131,14 +131,15 @@ private:
class Popup : public QtWayland::xdg_popup {
public:
- Popup(QWaylandXdgSurface *xdgSurface, QWaylandXdgSurface *parent, QtWayland::xdg_positioner *positioner);
+ Popup(QWaylandXdgSurface *xdgSurface, QWaylandWindow *parent, QtWayland::xdg_positioner *positioner);
~Popup() override;
void grab(QWaylandInputDevice *seat, uint serial);
void xdg_popup_popup_done() override;
QWaylandXdgSurface *m_xdgSurface = nullptr;
- QWaylandXdgSurface *m_parent = nullptr;
+ QWaylandXdgSurface *m_parentXdgSurface = nullptr;
+ QWaylandWindow *m_parent = nullptr;
bool m_grabbing = false;
};
diff --git a/tests/auto/client/xdgshell/tst_xdgshell.cpp b/tests/auto/client/xdgshell/tst_xdgshell.cpp
index 73d1eb9c..747875b4 100644
--- a/tests/auto/client/xdgshell/tst_xdgshell.cpp
+++ b/tests/auto/client/xdgshell/tst_xdgshell.cpp
@@ -46,6 +46,7 @@ private slots:
void configureStates();
void popup();
void tooltipOnPopup();
+ void tooltipAndSiblingPopup();
void switchPopups();
void hidePopupParent();
void pongs();
@@ -346,6 +347,92 @@ void tst_xdgshell::tooltipOnPopup()
QCOMPOSITOR_TRY_COMPARE(xdgPopup(0), nullptr);
}
+void tst_xdgshell::tooltipAndSiblingPopup()
+{
+ class ToolTip : public QRasterWindow {
+ public:
+ explicit ToolTip(QWindow *parent) {
+ setTransientParent(parent);
+ setFlags(Qt::ToolTip);
+ resize(100, 100);
+ show();
+ }
+ void mousePressEvent(QMouseEvent *event) override {
+ QRasterWindow::mousePressEvent(event);
+ m_popup = new QRasterWindow;
+ m_popup->setTransientParent(transientParent());
+ m_popup->setFlags(Qt::Popup);
+ m_popup->resize(100, 100);
+ m_popup->show();
+ }
+
+ QRasterWindow *m_popup = nullptr;
+ };
+
+ class Window : public QRasterWindow {
+ public:
+ void mousePressEvent(QMouseEvent *event) override {
+ QRasterWindow::mousePressEvent(event);
+ m_tooltip = new ToolTip(this);
+ }
+ ToolTip *m_tooltip = nullptr;
+ };
+
+ Window window;
+ window.resize(200, 200);
+ window.show();
+
+ QCOMPOSITOR_TRY_VERIFY(xdgToplevel());
+ exec([=] { xdgToplevel()->sendCompleteConfigure(); });
+ QCOMPOSITOR_TRY_VERIFY(xdgToplevel()->m_xdgSurface->m_committedConfigureSerial);
+
+ exec([=] {
+ auto *surface = xdgToplevel()->surface();
+ auto *p = pointer();
+ auto *c = client();
+ p->sendEnter(surface, {100, 100});
+ p->sendFrame(c);
+ p->sendButton(client(), BTN_LEFT, Pointer::button_state_pressed);
+ p->sendButton(client(), BTN_LEFT, Pointer::button_state_released);
+ p->sendFrame(c);
+ p->sendLeave(surface);
+ p->sendFrame(c);
+ });
+
+ QCOMPOSITOR_TRY_VERIFY(xdgPopup());
+ exec([=] { xdgPopup()->sendCompleteConfigure(QRect(100, 100, 100, 100)); });
+ QCOMPOSITOR_TRY_VERIFY(xdgPopup()->m_xdgSurface->m_committedConfigureSerial);
+ QCOMPOSITOR_TRY_VERIFY(!xdgPopup()->m_grabbed);
+
+ exec([=] {
+ auto *surface = xdgPopup()->surface();
+ auto *p = pointer();
+ auto *c = client();
+ p->sendEnter(surface, {100, 100});
+ p->sendFrame(c);
+ p->sendButton(client(), BTN_LEFT, Pointer::button_state_pressed);
+ p->sendButton(client(), BTN_LEFT, Pointer::button_state_released);
+ p->sendFrame(c);
+ });
+
+ QCOMPOSITOR_TRY_VERIFY(xdgPopup(1));
+ exec([=] { xdgPopup(1)->sendCompleteConfigure(QRect(100, 100, 100, 100)); });
+ QCOMPOSITOR_TRY_VERIFY(xdgPopup(1)->m_xdgSurface->m_committedConfigureSerial);
+ QCOMPOSITOR_TRY_VERIFY(xdgPopup(1)->m_grabbed);
+
+ // Close the middle tooltip (it should not close the sibling popup)
+ window.m_tooltip->close();
+
+ QCOMPOSITOR_TRY_COMPARE(xdgPopup(1), nullptr);
+ // Verify the remaining xdg surface is a grab popup..
+ QCOMPOSITOR_TRY_VERIFY(xdgPopup(0));
+ QCOMPOSITOR_TRY_VERIFY(xdgPopup(0)->m_grabbed);
+
+ window.m_tooltip->m_popup->close();
+ QCOMPOSITOR_TRY_COMPARE(xdgPopup(1), nullptr);
+ QCOMPOSITOR_TRY_COMPARE(xdgPopup(0), nullptr);
+}
+
// QTBUG-65680
void tst_xdgshell::switchPopups()
{
--
2.37.3

View File

@ -0,0 +1,28 @@
From e501ed58dbe44492a085587d1746a5848ac962f7 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 38/47] 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.37.3

View File

@ -1,7 +1,7 @@
From 10aa9f50861b6670cf9eb5e51725a8cc25c20aa7 Mon Sep 17 00:00:00 2001
From bada05134c79c9aa35ce898ec294e11a2aff949a Mon Sep 17 00:00:00 2001
From: Roman Genkhel <roman.genhel@lge.com>
Date: Thu, 12 Nov 2020 12:21:51 +0300
Subject: [PATCH 24/39] Check pointer for null before use in ASSERT
Subject: [PATCH 39/47] Check pointer for null before use in ASSERT
Task-number: QTBUG-85195
Change-Id: I331e54f6e58aa9d536351a55223610c60b3cb414
@ -12,19 +12,23 @@ Reviewed-by: David Edmundson <davidedmundson@kde.org>
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp
index 7de19a74..ac01dc05 100644
index 6923c9a7..a4190e16 100644
--- a/src/client/qwaylandwindow.cpp
+++ b/src/client/qwaylandwindow.cpp
@@ -552,8 +552,8 @@ void QWaylandWindow::sendRecursiveExposeEvent()
@@ -536,12 +536,12 @@ void QWaylandWindow::sendRecursiveExposeEvent()
void QWaylandWindow::attach(QWaylandBuffer *buffer, int x, int y)
{
- Q_ASSERT(!buffer->committed());
QReadLocker locker(&mSurfaceLock);
if (mSurface == nullptr)
return;
if (buffer) {
+ Q_ASSERT(!buffer->committed());
handleUpdate();
buffer->setBusy();
--
2.36.1
2.37.3

View File

@ -1,7 +1,7 @@
From 7daa34ec150141dcf090b4305d5d90c5a0696315 Mon Sep 17 00:00:00 2001
From 5972e1c4eccb1baf89d6cf779925eb35a49a8d2d Mon Sep 17 00:00:00 2001
From: Paul Olav Tvete <paul.tvete@qt.io>
Date: Mon, 6 Jul 2020 14:37:35 +0200
Subject: [PATCH 26/39] Use wl_surface.damage_buffer on the client side
Subject: [PATCH 40/47] Use wl_surface.damage_buffer on the client side
Prefer the newer, recommended damage_buffer when the compositor
supports it.
@ -20,10 +20,10 @@ Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
6 files changed, 28 insertions(+), 6 deletions(-)
diff --git a/src/client/qwaylanddisplay.cpp b/src/client/qwaylanddisplay.cpp
index a7ce280a..6f1bada5 100644
index 622ffe41..e8613ed8 100644
--- a/src/client/qwaylanddisplay.cpp
+++ b/src/client/qwaylanddisplay.cpp
@@ -488,7 +488,7 @@ void QWaylandDisplay::registry_global(uint32_t id, const QString &interface, uin
@@ -491,7 +491,7 @@ void QWaylandDisplay::registry_global(uint32_t id, const QString &interface, uin
if (interface == QStringLiteral("wl_output")) {
mWaitingScreens << new QWaylandScreen(this, version, id);
} else if (interface == QStringLiteral("wl_compositor")) {
@ -33,13 +33,13 @@ index a7ce280a..6f1bada5 100644
} else if (interface == QStringLiteral("wl_shm")) {
mShm.reset(new QWaylandShm(this, version, id));
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp
index acfe390e..4c5711a0 100644
index a4190e16..0967c975 100644
--- a/src/client/qwaylandwindow.cpp
+++ b/src/client/qwaylandwindow.cpp
@@ -571,7 +571,11 @@ void QWaylandWindow::attachOffset(QWaylandBuffer *buffer)
@@ -563,7 +563,11 @@ void QWaylandWindow::damage(const QRect &rect)
if (mSurface == nullptr)
return;
void QWaylandWindow::damage(const QRect &rect)
{
- mSurface->damage(rect.x(), rect.y(), rect.width(), rect.height());
+ const int s = scale();
+ if (mDisplay->compositorVersion() >= 4)
@ -49,7 +49,7 @@ index acfe390e..4c5711a0 100644
}
void QWaylandWindow::safeCommit(QWaylandBuffer *buffer, const QRegion &damage)
@@ -605,8 +609,14 @@ void QWaylandWindow::commit(QWaylandBuffer *buffer, const QRegion &damage)
@@ -599,8 +603,14 @@ void QWaylandWindow::commit(QWaylandBuffer *buffer, const QRegion &damage)
return;
attachOffset(buffer);
@ -127,5 +127,5 @@ index 949dc23d..d176837e 100644
uint32_t callback) override;
void surface_commit(Resource *resource) override;
--
2.36.1
2.37.3

View File

@ -0,0 +1,116 @@
From c618467da4c06528537026e2b78f92265bce446f Mon Sep 17 00:00:00 2001
From: David Edmundson <davidedmundson@kde.org>
Date: Fri, 5 Aug 2022 15:00:31 +0100
Subject: [PATCH 41/47] Client: clear focus on touch cancel
When we get a touch_cancel event all touches should be treated as
lifted.
The next frame call focus is set, with no pending touch points but
without having gone through touch_up. We call mPendingTouchPoints.last()
without guards even though it is potentially now empty.
Change-Id: I3719f9507c5d397d8641692271d878076b7c23b8
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
(cherry picked from commit dbdcd92363b44d89440dcb195d8cb9e6c34f0ddf)
---
src/client/qwaylandinputdevice.cpp | 1 +
tests/auto/client/seatv5/tst_seatv5.cpp | 30 +++++++++++++++++++++++
tests/auto/client/shared/coreprotocol.cpp | 7 ++++++
tests/auto/client/shared/coreprotocol.h | 1 +
4 files changed, 39 insertions(+)
diff --git a/src/client/qwaylandinputdevice.cpp b/src/client/qwaylandinputdevice.cpp
index c3cc4eca..4b90de84 100644
--- a/src/client/qwaylandinputdevice.cpp
+++ b/src/client/qwaylandinputdevice.cpp
@@ -1388,6 +1388,7 @@ void QWaylandInputDevice::Touch::touch_cancel()
if (touchExt)
touchExt->touchCanceled();
+ mFocus = nullptr;
QWindowSystemInterface::handleTouchCancelEvent(nullptr, mParent->mTouchDevice);
}
diff --git a/tests/auto/client/seatv5/tst_seatv5.cpp b/tests/auto/client/seatv5/tst_seatv5.cpp
index 9312c2e5..b063e0d9 100644
--- a/tests/auto/client/seatv5/tst_seatv5.cpp
+++ b/tests/auto/client/seatv5/tst_seatv5.cpp
@@ -73,6 +73,7 @@ private slots:
void multiTouch();
void multiTouchUpAndMotionFrame();
void tapAndMoveInSameFrame();
+ void cancelTouch();
};
void tst_seatv5::bindsToSeat()
@@ -646,5 +647,34 @@ void tst_seatv5::tapAndMoveInSameFrame()
QTRY_COMPARE(window.m_events.last().touchPoints.first().state(), Qt::TouchPointState::TouchPointReleased);
}
+void tst_seatv5::cancelTouch()
+{
+ TouchWindow window;
+ QCOMPOSITOR_TRY_VERIFY(xdgSurface() && xdgSurface()->m_committedConfigureSerial);
+
+ exec([=] {
+ auto *t = touch();
+ auto *c = client();
+ t->sendDown(xdgToplevel()->surface(), {32, 32}, 1);
+ t->sendFrame(c);
+ t->sendCancel(c);
+ t->sendFrame(c);
+ });
+
+ QTRY_VERIFY(!window.m_events.empty());
+ {
+ auto e = window.m_events.takeFirst();
+ QCOMPARE(e.type, QEvent::TouchBegin);
+ QCOMPARE(e.touchPointStates, QEventPoint::State::Pressed);
+ QCOMPARE(e.touchPoints.length(), 1);
+ QCOMPARE(e.touchPoints.first().position(), QPointF(32-window.frameMargins().left(), 32-window.frameMargins().top()));
+ }
+ {
+ auto e = window.m_events.takeFirst();
+ QCOMPARE(e.type, QEvent::TouchCancel);
+ QCOMPARE(e.touchPoints.length(), 0);
+ }
+}
+
QCOMPOSITOR_TEST_MAIN(tst_seatv5)
#include "tst_seatv5.moc"
diff --git a/tests/auto/client/shared/coreprotocol.cpp b/tests/auto/client/shared/coreprotocol.cpp
index 0d988521..d1a2e7cb 100644
--- a/tests/auto/client/shared/coreprotocol.cpp
+++ b/tests/auto/client/shared/coreprotocol.cpp
@@ -451,6 +451,13 @@ void Touch::sendFrame(wl_client *client)
send_frame(r->handle);
}
+void Touch::sendCancel(wl_client *client)
+{
+ const auto touchResources = resourceMap().values(client);
+ for (auto *r : touchResources)
+ send_cancel(r->handle);
+}
+
uint Keyboard::sendEnter(Surface *surface)
{
auto serial = m_seat->m_compositor->nextSerial();
diff --git a/tests/auto/client/shared/coreprotocol.h b/tests/auto/client/shared/coreprotocol.h
index 296dbf47..210d8ddb 100644
--- a/tests/auto/client/shared/coreprotocol.h
+++ b/tests/auto/client/shared/coreprotocol.h
@@ -364,6 +364,7 @@ public:
uint sendUp(wl_client *client, int id);
void sendMotion(wl_client *client, const QPointF &position, int id);
void sendFrame(wl_client *client);
+ void sendCancel(wl_client *client);
Seat *m_seat = nullptr;
};
--
2.37.3

View File

@ -0,0 +1,39 @@
From 566f577ee2b0fa1f13bcc1a3cda64b75dbc1b3df Mon Sep 17 00:00:00 2001
From: David Edmundson <davidedmundson@kde.org>
Date: Thu, 3 Feb 2022 19:42:33 +0000
Subject: [PATCH 42/47] Guard mResizeDirty by the correctMutex
mResizeDirty is used in the GUI thread in setCanResize which can be
called from the GUI thread. It is queried and set whilst the resizeLock
is held. We need to guard our usage.
Change-Id: I5f8dcf8aa2cb2c4bb6274103df1da9e3e268605a
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
(cherry picked from commit 4ac96662c936821efff2875bbe555b40612caf8a)
---
src/client/qwaylandwindow.cpp | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp
index 0967c975..c6477ec4 100644
--- a/src/client/qwaylandwindow.cpp
+++ b/src/client/qwaylandwindow.cpp
@@ -358,11 +358,12 @@ void QWaylandWindow::setGeometry(const QRect &rect)
if (mWindowDecoration)
mWindowDecoration->update();
- if (mResizeAfterSwap && windowType() == Egl && mSentInitialResize)
+ if (mResizeAfterSwap && windowType() == Egl && mSentInitialResize) {
+ QMutexLocker lock(&mResizeLock);
mResizeDirty = true;
- else
+ } else {
QWindowSystemInterface::handleGeometryChange(window(), geometry());
-
+ }
mSentInitialResize = true;
}
QRect exposeGeometry(QPoint(), geometry().size());
--
2.37.3

View File

@ -0,0 +1,72 @@
From 489a0a1fc1db61f46e2b232ae4523723a05304b7 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 43/47] 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 3999a5ee..79177540 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());
}
}
@@ -437,6 +447,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.37.3

View File

@ -0,0 +1,29 @@
From f77065f0cc9da073535e7347eac1ee150dde1908 Mon Sep 17 00:00:00 2001
From: Albert Astals Cid <aacid@kde.org>
Date: Fri, 9 Sep 2022 15:37:49 +0200
Subject: [PATCH 44/47] Fix compile tests
Broken in c618467da4c06528537026e2b78f92265bce446f
---
tests/auto/client/seatv5/tst_seatv5.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/auto/client/seatv5/tst_seatv5.cpp b/tests/auto/client/seatv5/tst_seatv5.cpp
index b063e0d9..2ea382f1 100644
--- a/tests/auto/client/seatv5/tst_seatv5.cpp
+++ b/tests/auto/client/seatv5/tst_seatv5.cpp
@@ -665,9 +665,9 @@ void tst_seatv5::cancelTouch()
{
auto e = window.m_events.takeFirst();
QCOMPARE(e.type, QEvent::TouchBegin);
- QCOMPARE(e.touchPointStates, QEventPoint::State::Pressed);
+ QCOMPARE(e.touchPointStates, Qt::TouchPointPressed);
QCOMPARE(e.touchPoints.length(), 1);
- QCOMPARE(e.touchPoints.first().position(), QPointF(32-window.frameMargins().left(), 32-window.frameMargins().top()));
+ QCOMPARE(e.touchPoints.first().pos(), QPointF(32-window.frameMargins().left(), 32-window.frameMargins().top()));
}
{
auto e = window.m_events.takeFirst();
--
2.37.3

View File

@ -0,0 +1,40 @@
From 215eec416e669ba7a1b7473eedf78d75d5c8d684 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 45/47] 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.37.3

View File

@ -0,0 +1,65 @@
From 4ab7939c280b80c89411561b33d1bbda4666d580 Mon Sep 17 00:00:00 2001
From: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Date: Tue, 9 Nov 2021 13:23:41 +0100
Subject: [PATCH 46/47] Fix missing update when toggling client-side
decorations
When CSD is toggled while a window is showing, it would change the
size and recreate the buffers, but since the widget area remained
the same size, we would not trigger a redraw. The result was that
when you got any update to the window, it would redraw the widgets
that had changed, and the rest would be transparent.
Since this is a fairly specialized case, we fix it the simple way,
by just issuing an extra update when it happens.
This also required an update to the surface test, since there is
an additional buffer commit in the beginning of the sequence now.
Pick-to: 5.15 6.2 6.3
Fixes: QTBUG-95032
Change-Id: Ic4bdb9c66a2ea76546926dd622f2d2dac5dce10c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Liang Qi <liang.qi@qt.io>
(cherry picked from commit af7b60ade5c4be81cbc58eb18307c017d5594071)
---
src/client/qwaylandwindow.cpp | 7 +++++++
tests/auto/client/surface/tst_surface.cpp | 4 ++++
2 files changed, 11 insertions(+)
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp
index c6477ec4..cb610510 100644
--- a/src/client/qwaylandwindow.cpp
+++ b/src/client/qwaylandwindow.cpp
@@ -867,6 +867,13 @@ bool QWaylandWindow::createDecoration()
subsurf->set_position(pos.x() + m.left(), pos.y() + m.top());
}
sendExposeEvent(QRect(QPoint(), geometry().size()));
+
+ // This is a special case where the buffer is recreated, but since
+ // the content rect remains the same, the widgets remain the same
+ // 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();
}
return mWindowDecoration;
diff --git a/tests/auto/client/surface/tst_surface.cpp b/tests/auto/client/surface/tst_surface.cpp
index 95e4e609..60c672ce 100644
--- a/tests/auto/client/surface/tst_surface.cpp
+++ b/tests/auto/client/surface/tst_surface.cpp
@@ -129,6 +129,10 @@ void tst_surface::waitForFrameCallbackGl()
// Make sure we follow frame callbacks for some frames
for (int i = 0; i < 5; ++i) {
xdgPingAndWaitForPong(); // Make sure things have happened on the client
+ if (!qEnvironmentVariableIntValue("QT_WAYLAND_DISABLE_WINDOWDECORATION") && i == 0) {
+ QCOMPARE(bufferSpy.count(), 1);
+ bufferSpy.removeFirst();
+ }
exec([&] {
QVERIFY(bufferSpy.empty()); // Make sure no extra buffers have arrived
QVERIFY(!xdgToplevel()->surface()->m_waitingFrameCallbacks.empty());
--
2.37.3

View File

@ -0,0 +1,43 @@
From a3718734e38a53b36de2025f64e06d186516c1dd 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 47/47] 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 cb610510..771c96cc 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.37.3

View File

@ -2,8 +2,8 @@
Summary: Qt5 - Wayland platform support and QtCompositor module
Name: qt5-%{qt_module}
Version: 5.15.5
Release: 4%{?dist}
Version: 5.15.6
Release: 1%{?dist}
License: LGPLv3
Url: http://www.qt.io
@ -13,7 +13,7 @@ Source0: https://download.qt.io/official_releases/qt/%{majmin}/%{version}/submod
## Upstream patches
## repo: https://invent.kde.org/qt/qt/qtwayland
## branch: kde/5.15
## git format-patch v5.15.4-lts-lgpl
## git format-patch v5.15.6-lts-lgpl
Patch1: 0001-Client-Announce-an-output-after-receiving-more-compl.patch
Patch2: 0002-Fix-issue-with-repeated-window-size-changes.patch
Patch3: 0003-Client-Connect-drags-being-accepted-to-updating-the-.patch
@ -22,37 +22,45 @@ Patch5: 0005-Client-Set-XdgShell-size-hints-before-the-first-comm.patch
Patch6: 0006-Fix-build.patch
Patch7: 0007-Fix-remove-listener.patch
Patch8: 0008-Hook-up-queryKeyboardModifers.patch
Patch9: 0009-Do-not-update-the-mask-if-we-do-not-have-a-surface.patch
Patch10: 0010-Correctly-detect-if-image-format-is-supported-by-QIm.patch
Patch11: 0011-Wayland-client-Fix-crash-when-windows-are-shown-hidd.patch
Patch12: 0012-Client-Don-t-always-recreate-frame-callbacks.patch
Patch13: 0013-Client-Always-destroy-frame-callback-in-the-actual-c.patch
Patch14: 0014-Fix-the-logic-for-decoding-modifiers-map-in-Wayland-.patch
Patch15: 0015-Wayland-client-use-wl_keyboard-to-determine-active-s.patch
Patch16: 0016-Client-do-not-empty-clipboard-when-a-new-popup-windo.patch
Patch17: 0017-Set-preedit-cursor-when-cursor-equals-to-0.patch
Patch18: 0018-Client-Implement-DataDeviceV3.patch
Patch19: 0019-Client-Delay-deletion-of-QDrag-object-until-after-we.patch
Patch20: 0020-Client-Avoid-processing-of-events-when-showing-windo.patch
Patch21: 0021-Handle-registry_global-out-of-constructor.patch
Patch22: 0022-Connect-flushRequest-after-forceRoundTrip.patch
Patch23: 0023-Move-the-wayland-socket-polling-to-a-separate-event-.patch
Patch24: 0024-Check-pointer-for-null-before-use-in-ASSERT.patch
Patch25: 0025-Do-not-create-decorations-when-the-shellSurface-is-n.patch
Patch26: 0026-Use-wl_surface.damage_buffer-on-the-client-side.patch
Patch27: 0027-Fix-crash-if-no-input-method-module-could-be-loaded.patch
Patch28: 0028-Client-Remove-mWaitingForUpdateDelivery.patch
Patch29: 0029-Cursor-position-0-should-still-show-the-cursor.patch
Patch30: 0030-Update-the-preedit-styling-mapping.patch
Patch31: 0031-client-Simplify-round-trip-behavior.patch
Patch32: 0032-Client-Fix-opaque-region-setter.patch
Patch33: 0033-Use-proper-dependencies-in-compile-tests.patch
Patch34: 0034-client-update-button-state-and-etc-in-pointer_leave.patch
Patch35: 0035-Revert-Client-Remove-mWaitingForUpdateDelivery.patch
Patch36: 0036-Fix-race-condition-on-mWaitingForUpdateDelivery.patch
Patch37: 0037-use-poll-2-when-reading-from-clipboard.patch
Patch38: 0038-Reduce-memory-leakage.patch
Patch39: 0039-Fix-build-with-libcxx-missing-array-include.patch
Patch9: 0009-Correctly-detect-if-image-format-is-supported-by-QIm.patch
Patch10: 0010-Wayland-client-Fix-crash-when-windows-are-shown-hidd.patch
Patch11: 0011-Client-Don-t-always-recreate-frame-callbacks.patch
Patch12: 0012-Client-Always-destroy-frame-callback-in-the-actual-c.patch
Patch13: 0013-Fix-the-logic-for-decoding-modifiers-map-in-Wayland-.patch
Patch14: 0014-Wayland-client-use-wl_keyboard-to-determine-active-s.patch
Patch15: 0015-Client-do-not-empty-clipboard-when-a-new-popup-windo.patch
Patch16: 0016-Set-preedit-cursor-when-cursor-equals-to-0.patch
Patch17: 0017-Client-Implement-DataDeviceV3.patch
Patch18: 0018-Client-Delay-deletion-of-QDrag-object-until-after-we.patch
Patch19: 0019-Client-Avoid-processing-of-events-when-showing-windo.patch
Patch20: 0020-Handle-registry_global-out-of-constructor.patch
Patch21: 0021-Connect-flushRequest-after-forceRoundTrip.patch
Patch22: 0022-Move-the-wayland-socket-polling-to-a-separate-event-.patch
Patch23: 0023-Do-not-create-decorations-when-the-shellSurface-is-n.patch
Patch24: 0024-Fix-crash-if-no-input-method-module-could-be-loaded.patch
Patch25: 0025-Client-Remove-mWaitingForUpdateDelivery.patch
Patch26: 0026-Cursor-position-0-should-still-show-the-cursor.patch
Patch27: 0027-Update-the-preedit-styling-mapping.patch
Patch28: 0028-client-Simplify-round-trip-behavior.patch
Patch29: 0029-Client-Fix-opaque-region-setter.patch
Patch30: 0030-Use-proper-dependencies-in-compile-tests.patch
Patch31: 0031-client-update-button-state-and-etc-in-pointer_leave.patch
Patch32: 0032-Revert-Client-Remove-mWaitingForUpdateDelivery.patch
Patch33: 0033-Fix-race-condition-on-mWaitingForUpdateDelivery.patch
Patch34: 0034-use-poll-2-when-reading-from-clipboard.patch
Patch35: 0035-Reduce-memory-leakage.patch
Patch36: 0036-Fix-build-with-libcxx-missing-array-include.patch
Patch37: 0037-Only-close-popup-in-the-the-hierchary.patch
Patch38: 0038-Build-fixes-for-GCC-11.patch
Patch39: 0039-Check-pointer-for-null-before-use-in-ASSERT.patch
Patch40: 0040-Use-wl_surface.damage_buffer-on-the-client-side.patch
Patch41: 0041-Client-clear-focus-on-touch-cancel.patch
Patch42: 0042-Guard-mResizeDirty-by-the-correctMutex.patch
Patch43: 0043-client-Synthesize-enter-leave-event-for-popup-in-xdg.patch
Patch44: 0044-Fix-compile-tests.patch
Patch45: 0045-Use-CRLF-line-delimiter-for-text-uri-list-data.patch
Patch46: 0046-Fix-missing-update-when-toggling-client-side-decorat.patch
Patch47: 0047-Avoid-calling-requestUpdate-from-wrong-thread.patch
Patch50: 0050-Client-set-constraint-adjustments-for-popups-in-xdg.patch
@ -61,9 +69,7 @@ Patch50: 0050-Client-set-constraint-adjustments-for-popups-in-xdg.patch
# https://invent.kde.org/qt/qt/qtwayland/-/merge_requests/47
Patch100: 0100-Keep-toplevel-windows-in-the-top-left-corner-of-the-screen.patch
# Disable for now, there is a Qt bug making this broken
Patch102: qtwayland-decoration-support-backports-from-qt6.patch
# Patch103: qtwayland-client-expose-toplevel-window-state.patch
# Upstreamable patches
@ -172,6 +178,9 @@ popd
%changelog
* Tue Sep 20 2022 Jan Grulich <jgrulich@redhat.com> - 5.15.6-1
- 5.15.6
* Thu Aug 25 2022 Jan Grulich <jgrulich@redhat.com> - 5.15.5-4
- Re-enable CSD backports from Qt6 (will be used by QGnomePlatform)

View File

@ -1 +1,2 @@
SHA512 (qtwayland-everywhere-opensource-src-5.15.5.tar.xz) = 828dceb7bc54ce610a73f110f0aca332a90cf95df4a3bc971bd21c4e878366cb8d2248e609b73ce4d381579a143843c87a62f23dcc95767e522874e53a1b0327
SHA512 (qtwayland-everywhere-opensource-src-5.15.6.tar.xz) = 824cb4dfd2bd9d858f38430332a359cf6cd2b256c91b0bafcbe49c8847cb41a7ced79ef8abd5469170837525639df26fcbcdfb49ffefc4fc4cde0830d9afe98c