Sync with Fedora

Resolves: bz#2051384
This commit is contained in:
Jan Grulich 2022-02-15 13:38:02 +01:00
parent 3aef25cacc
commit f53fc2487f
53 changed files with 614 additions and 89 deletions

View File

@ -1,7 +1,7 @@
From 30cb2a87fcc6265232cb5a3ffce9836da6e531d6 Mon Sep 17 00:00:00 2001
From: Jani Heikkinen <jani.heikkinen@qt.io>
Date: Tue, 27 Oct 2020 07:48:51 +0200
Subject: [PATCH 01/36] Bump version
Subject: [PATCH 01/52] Bump version
Change-Id: I6b2c26a9fea447f1de1d768a72aba72055a13cb7
---
@ -19,5 +19,5 @@ index f63b6641..bb8d0645 100644
-MODULE_VERSION = 5.15.2
+MODULE_VERSION = 5.15.3
--
2.33.1
2.35.1

View File

@ -1,7 +1,7 @@
From f9d5fc2e94c2116130456f4b4f8bd2f3a0c88d20 Mon Sep 17 00:00:00 2001
From: Kai Koehne <kai.koehne@qt.io>
Date: Tue, 27 Oct 2020 16:12:30 +0100
Subject: [PATCH 02/36] Replace remaining LGPLv3 headers in QtWaylandCompositor
Subject: [PATCH 02/52] Replace remaining LGPLv3 headers in QtWaylandCompositor
with GPLv3
Use same header as for the rest of the module.
@ -968,5 +968,5 @@ index cd6bad57..16bb3354 100644
** $QT_END_LICENSE$
**
--
2.33.1
2.35.1

View File

@ -1,7 +1,7 @@
From cc652bdd4ec7692a68db8afef2a709b74581c2cd Mon Sep 17 00:00:00 2001
From: Paul Wicking <paul.wicking@qt.io>
Date: Tue, 27 Oct 2020 14:56:32 +0100
Subject: [PATCH 03/36] Doc: List correct license information for the module
Subject: [PATCH 03/52] Doc: List correct license information for the module
Fixes: QTBUG-87959
Change-Id: I1c5cd15e0dd6f81e87690e54cd4e526ce668a8aa
@ -35,5 +35,5 @@ index dc95dc5b..fcdd13f7 100644
Qt Wayland Compositor and the Qt Wayland integration plugin
--
2.33.1
2.35.1

View File

@ -1,7 +1,7 @@
From 88c8df4eab81316bc055c8be82b0febc70330dbe Mon Sep 17 00:00:00 2001
From: Antti Kokko <antti.kokko@qt.io>
Date: Tue, 27 Oct 2020 10:02:11 +0200
Subject: [PATCH 04/36] Add changes file for Qt 5.15.2
Subject: [PATCH 04/52] Add changes file for Qt 5.15.2
+ 7d7ac7f0a4bd6a7956448ddb0ba44c12755dca2e Client: Send subsurface expose event when toplevel is configured
+ 18ab3edaf2a4cdd1e9df6e166cf51a69a9785ecd Client: Initialize mScale on creation instead of on show
@ -73,5 +73,5 @@ index 00000000..e12ac096
+ - [QTBUG-86176] We now send subsurface expose events when a different
+ toplevel (such as a dialog) is configured.
--
2.33.1
2.35.1

View File

@ -1,7 +1,7 @@
From e5c272423d1bba2825086b82fd97499237a6fa4b Mon Sep 17 00:00:00 2001
From: Vlad Zahorodnii <vlad.zahorodnii@kde.org>
Date: Fri, 30 Oct 2020 16:55:30 +0200
Subject: [PATCH 05/36] Scanner: Avoid accessing dangling pointers in
Subject: [PATCH 05/52] Scanner: Avoid accessing dangling pointers in
destroy_func()
Usually, the object associated with the resource gets destroyed in the
@ -34,5 +34,5 @@ index 1d635f06..e2f87bbd 100644
printf(" }\n");
printf(" delete resource;\n");
--
2.33.1
2.35.1

View File

@ -1,7 +1,7 @@
From a825fb5f714fd79d16cc3ebbdd327e7961b07d0a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= <morten.sorvig@qt.io>
Date: Mon, 16 Nov 2020 19:37:33 +0100
Subject: [PATCH 06/36] Make setting QT_SCALE_FACTOR work on Wayland
Subject: [PATCH 06/52] Make setting QT_SCALE_FACTOR work on Wayland
Follow-up to 8cb1b07aea12d50b4fecc45c903705dfd368022a,
fixes one additional case (Use of minimum/maximum size).
@ -34,5 +34,5 @@ index bc031ed5..eb053406 100644
if (mSubSurfaceWindow) {
QMargins m = QPlatformWindow::parent()->frameMargins();
--
2.33.1
2.35.1

View File

@ -1,7 +1,7 @@
From 2c0a03e9aea13831d05ac03996949f888afd5085 Mon Sep 17 00:00:00 2001
From: Jaehak Lee <jaehak.lee@mobis.co.kr>
Date: Sun, 8 Nov 2020 11:40:06 +0900
Subject: [PATCH 07/36] Do not try to eglMakeCurrent for unintended case
Subject: [PATCH 07/52] Do not try to eglMakeCurrent for unintended case
The QSGThreadedRenderLoop::hide can be called at twice,
when the QWindowPrivate::setVisible(false) is called.
@ -58,5 +58,5 @@ index 46c7bb76..93edaec0 100644
}
--
2.33.1
2.35.1

View File

@ -1,7 +1,7 @@
From 10005185e06857ce119c50fe710f9eedde06ec5e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= <morten.sorvig@qt.io>
Date: Fri, 13 Nov 2020 11:21:50 +0100
Subject: [PATCH 08/36] Make setting QT_SCALE_FACTOR work on Wayland
Subject: [PATCH 08/52] Make setting QT_SCALE_FACTOR work on Wayland
QWindow geometry accessors return geometry in device
independent pixels. Normally this coordinate system
@ -108,5 +108,5 @@ index b6d23ac1..1c762944 100644
if ((m_pending.states & Qt::WindowActive) && !(m_applied.states & Qt::WindowActive))
m_xdgSurface->m_window->display()->handleWindowActivated(m_xdgSurface->m_window);
--
2.33.1
2.35.1

View File

@ -1,7 +1,7 @@
From dba4bc4f1d6dfee9fe9433c55b15653d703bed4f Mon Sep 17 00:00:00 2001
From: Andreas Cord-Landwehr <cordlandwehr@kde.org>
Date: Wed, 2 Dec 2020 20:55:52 +0100
Subject: [PATCH 09/36] Ensure that grabbing is performed in correct context
Subject: [PATCH 09/52] Ensure that grabbing is performed in correct context
For multi-display rendering on EGL, it is mandatory that the grabbing of
the surface happens in the same EGL context as the surface belongs to.
@ -31,5 +31,5 @@ index 49f0860e..db1cf00f 100644
emit grabber->failed(QWaylandSurfaceGrabber::UnknownBufferType);
#endif
--
2.33.1
2.35.1

View File

@ -1,7 +1,7 @@
From a8d35b3c18bdb05a0da3ed50a554a7b7bd4ebed3 Mon Sep 17 00:00:00 2001
From: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Date: Mon, 30 Nov 2020 13:13:18 +0100
Subject: [PATCH 10/36] Fix leaked subsurface wayland items
Subject: [PATCH 10/52] Fix leaked subsurface wayland items
Whenever a subsurface was added we would create a QWaylandQuickItem,
but this was never deleted. It is one-to-one with the surface, so it
@ -32,5 +32,5 @@ index 15f0195c..2218f43a 100644
bool success = QMetaObject::invokeMethod(d->subsurfaceHandler, "handleSubsurfaceAdded", Q_ARG(QWaylandSurface *, childSurface));
if (!success)
--
2.33.1
2.35.1

View File

@ -1,7 +1,7 @@
From 9ee2ea141adc7765f6c212e63839ef23a4494b30 Mon Sep 17 00:00:00 2001
From: Weng Xuetian <wengxt@gmail.com>
Date: Tue, 9 Mar 2021 10:43:59 -0800
Subject: [PATCH 11/36] Use qWarning and _exit() instead of qFatal for wayland
Subject: [PATCH 11/52] Use qWarning and _exit() instead of qFatal for wayland
error
This type of error is likely to happen upon system logout. qFatal would
@ -34,5 +34,5 @@ index fe094f6f..f10c1f79 100644
void QWaylandDisplay::flushRequests()
--
2.33.1
2.35.1

View File

@ -1,7 +1,7 @@
From 9df11e79b46c77d8c83f765b2a8e85b639fd55a2 Mon Sep 17 00:00:00 2001
From: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Date: Tue, 5 Jan 2021 09:08:50 +0100
Subject: [PATCH 12/36] Fix memory leak in QWaylandGLContext
Subject: [PATCH 12/52] Fix memory leak in QWaylandGLContext
We were leaking an EGL context with every GL context created,
which lead to rapid OOM errors in stress tests.
@ -34,5 +34,5 @@ index 681f82f4..befadedc 100644
bool QWaylandGLContext::makeCurrent(QPlatformSurface *surface)
--
2.33.1
2.35.1

View File

@ -1,7 +1,7 @@
From 7db4f83c39d2a0c709bc0b9c0de3946d3b4ebfd5 Mon Sep 17 00:00:00 2001
From: David Edmundson <davidedmundson@kde.org>
Date: Mon, 16 Nov 2020 14:57:36 +0000
Subject: [PATCH 13/36] Client: Send set_window_geometry only once configured
Subject: [PATCH 13/52] Client: Send set_window_geometry only once configured
The geometry only makes sense when a buffer exists, our currently send
value is somewhat meaningless, but till now harmless.
@ -37,5 +37,5 @@ index 9b343702..e875af3a 100644
if (isOpaque() && mMask.isEmpty())
--
2.33.1
2.35.1

View File

@ -1,7 +1,7 @@
From a3e3ac1c86a956b25b1dc24f14518b6e6c96bcfc Mon Sep 17 00:00:00 2001
From: Jan Grulich <jgrulich@redhat.com>
Date: Wed, 10 Feb 2021 17:11:27 +0100
Subject: [PATCH 14/36] Translate opaque area with frame margins
Subject: [PATCH 14/52] Translate opaque area with frame margins
The opaque area doesn't take window decorations into account, which may
result into possible graphical artefacts.
@ -36,5 +36,5 @@ index e875af3a..2af39977 100644
wl_region_destroy(region);
}
--
2.33.1
2.35.1

View File

@ -1,7 +1,7 @@
From 2073ff99e62d4f99ed3f1f45559c5b68a61c5f66 Mon Sep 17 00:00:00 2001
From: David Edmundson <davidedmundson@kde.org>
Date: Mon, 14 Sep 2020 17:08:39 +0100
Subject: [PATCH 15/36] Client: Send exposeEvent to parent on subsurface
Subject: [PATCH 15/52] Client: Send exposeEvent to parent on subsurface
position changes
When a subsurface is moved, we need the parent window to commit to apply
@ -93,5 +93,5 @@ index b8a65f15..95e4e609 100644
// Used to cause a crash in libwayland (QTBUG-79674)
--
2.33.1
2.35.1

View File

@ -1,7 +1,7 @@
From 6810b0f66a34056bfe0da7299d7a768e700e58f5 Mon Sep 17 00:00:00 2001
From: Jan Grulich <jgrulich@redhat.com>
Date: Thu, 11 Feb 2021 15:12:32 +0100
Subject: [PATCH 16/36] Get correct decoration margins region
Subject: [PATCH 16/52] Get correct decoration margins region
Size we use to calculate margins region already contains size including
margins. This resulted into bigger region and not properly damaging
@ -35,5 +35,5 @@ index 87dd6cea..b6ee43c9 100644
}
--
2.33.1
2.35.1

View File

@ -1,7 +1,7 @@
From cea69b8adec1e61adc1fa04cbf46b77c0d72c75e Mon Sep 17 00:00:00 2001
From: Aleix Pol <aleixpol@kde.org>
Date: Mon, 23 Nov 2020 20:07:02 +0100
Subject: [PATCH 17/36] xdgshell: Tell the compositor the screen we're
Subject: [PATCH 17/52] xdgshell: Tell the compositor the screen we're
expecting to fill
The xdgshell protocol allows us to tell the output to fill. This makes
@ -37,5 +37,5 @@ index 1c762944..3a1569f7 100644
}
--
2.33.1
2.35.1

View File

@ -1,7 +1,7 @@
From 2f84a874da064069461284db1da36dc818949ec1 Mon Sep 17 00:00:00 2001
From: Albert Astals Cid <aacid@kde.org>
Date: Sat, 10 Apr 2021 12:10:16 +0200
Subject: [PATCH 18/36] Fix compilation
Subject: [PATCH 18/52] Fix compilation
9df11e79b46c77d8c83f765b2a8e85b639fd55a2 can't be backported 1:1
---
@ -22,5 +22,5 @@ index befadedc..95d1049c 100644
bool QWaylandGLContext::makeCurrent(QPlatformSurface *surface)
--
2.33.1
2.35.1

View File

@ -1,7 +1,7 @@
From 91c48320633e493b4cd519e5d73b836a878b2b77 Mon Sep 17 00:00:00 2001
From: Aleix Pol <aleixpol@kde.org>
Date: Wed, 10 Mar 2021 01:09:13 +0100
Subject: [PATCH 19/36] client: Allow QWaylandInputContext to accept composed
Subject: [PATCH 19/52] client: Allow QWaylandInputContext to accept composed
key combinations
At the moment, we are forcing user to choose to either compose or use
@ -253,5 +253,5 @@ index 7ad8e05e..c53ccb78 100644
}
--
2.33.1
2.35.1

View File

@ -1,7 +1,7 @@
From d5186701e27ad6f09f3944809cec2a25c5328026 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 20/36] Client: Announce an output after receiving more
Subject: [PATCH 20/52] 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.33.1
2.35.1

View File

@ -1,7 +1,7 @@
From 62494312db0f58053d1342bfacc7984186fdf3a6 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 21/36] Fix issue with repeated window size changes
Subject: [PATCH 21/52] 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.33.1
2.35.1

View File

@ -1,7 +1,7 @@
From 1ccebbab3a42690a0812e2c4c76016799bf6cf1f Mon Sep 17 00:00:00 2001
From: Albert Astals Cid <albert.astals.cid@kdab.com>
Date: Mon, 10 May 2021 14:38:49 +0200
Subject: [PATCH 22/36] Include locale.h for setlocale/LC_CTYPE
Subject: [PATCH 22/52] Include locale.h for setlocale/LC_CTYPE
Pick-to: 5.15
Change-Id: Iced32a31a63cec71008549c1e0961d59ffc45a37
@ -27,5 +27,5 @@ index ef5aa375..503fd735 100644
Q_LOGGING_CATEGORY(qLcQpaInputMethods, "qt.qpa.input.methods")
--
2.33.1
2.35.1

View File

@ -1,7 +1,7 @@
From fcc2f57cefa66339c8cb6632f45a47fbb99bb60d Mon Sep 17 00:00:00 2001
From: David Edmundson <davidedmundson@kde.org>
Date: Tue, 9 Feb 2021 16:09:21 +0000
Subject: [PATCH 23/36] Client: Connect drags being accepted to updating the
Subject: [PATCH 23/52] 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.33.1
2.35.1

View File

@ -1,7 +1,7 @@
From 1b5e43a593e917610e6245f7a272ac081c508ba4 Mon Sep 17 00:00:00 2001
From: David Edmundson <davidedmundson@kde.org>
Date: Fri, 14 May 2021 13:23:24 +0100
Subject: [PATCH 24/36] Client: Disconnect registry listener on destruction
Subject: [PATCH 24/52] 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.33.1
2.35.1

View File

@ -1,7 +1,7 @@
From 36a552fa530be57091e986ebd1468d75d3061743 Mon Sep 17 00:00:00 2001
From: David Edmundson <davidedmundson@kde.org>
Date: Mon, 3 May 2021 23:01:53 +0100
Subject: [PATCH 25/36] Client: Set XdgShell size hints before the first commit
Subject: [PATCH 25/52] 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.33.1
2.35.1

View File

@ -1,7 +1,7 @@
From a8ddf1a7296e2d28b36231a391807226a7329ae4 Mon Sep 17 00:00:00 2001
From: David Edmundson <davidedmundson@kde.org>
Date: Mon, 14 Jun 2021 12:45:37 +0100
Subject: [PATCH 26/36] Fix build
Subject: [PATCH 26/52] 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.33.1
2.35.1

View File

@ -1,7 +1,7 @@
From d1c4a459faa1d514026c4834828cb33024ac2ceb Mon Sep 17 00:00:00 2001
From: Zhang Liang <zhanglianga@uniontech.com>
Date: Mon, 1 Feb 2021 19:29:43 +0800
Subject: [PATCH 27/36] Fix: remove listener
Subject: [PATCH 27/52] 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.33.1
2.35.1

View File

@ -1,7 +1,7 @@
From a6476d1a1c78eb7f17408241b268404e27b3e161 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 28/36] Hook up queryKeyboardModifers
Subject: [PATCH 28/52] 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.33.1
2.35.1

View File

@ -1,7 +1,7 @@
From d4c41797b61a5a8da47c5821711aca72e756dcbf Mon Sep 17 00:00:00 2001
From: Aleix Pol <aleixpol@kde.org>
Date: Tue, 13 Jul 2021 13:32:15 +0200
Subject: [PATCH 29/36] Do not update the mask if we do not have a surface
Subject: [PATCH 29/52] 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().
@ -40,5 +40,5 @@ index e96d8fe9..bd70f4af 100644
mSurface->set_input_region(nullptr);
--
2.33.1
2.35.1

View File

@ -1,7 +1,7 @@
From 3c420cd180397e3f42c8a436a7f1b11465925bdd Mon Sep 17 00:00:00 2001
From: Jan Blackquill <uhhadd@gmail.com>
Date: Tue, 24 Aug 2021 14:36:34 -0400
Subject: [PATCH 30/36] Correctly detect if image format is supported by
Subject: [PATCH 30/52] 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.33.1
2.35.1

View File

@ -1,7 +1,7 @@
From 1c53ba6dfebbf1d6e87c9ad1f2bbda94e3d45bf7 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 31/36] Wayland client: Fix crash when windows are shown/hidden
Subject: [PATCH 31/52] 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.33.1
2.35.1

View File

@ -1,7 +1,7 @@
From 3be586cd8b6c8313cb6b8b7d61be17706f79590e 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 32/36] Client: Don't always recreate frame callbacks
Subject: [PATCH 32/52] 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
@ -73,5 +73,5 @@ index 2fdd0a7c..e2593314 100644
void tst_xdgshell::popup()
--
2.33.1
2.35.1

View File

@ -1,7 +1,7 @@
From efe6edcaf8eba601dff99ec6ad4457c8a4442f86 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 33/36] Client: Always destroy frame callback in the actual
Subject: [PATCH 33/52] Client: Always destroy frame callback in the actual
callback
It's good hygiene to destroy all frame callbacks. Destroy the
@ -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.33.1
2.35.1

View File

@ -1,7 +1,7 @@
From 02f9585ca19c17ae0978b864195533dc527d825e 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 34/36] Fix the logic for decoding modifiers map in Wayland
Subject: [PATCH 34/52] 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 503fd735..e290baa2 100644
return ret;
}
--
2.33.1
2.35.1

View File

@ -1,7 +1,7 @@
From 5c180bdc1042e7cb1555e188051f09e219b00ec9 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 35/36] Wayland client: use wl_keyboard to determine active
Subject: [PATCH 35/52] Wayland client: use wl_keyboard to determine active
state
Commit f497a5bb87270174b8e0106b7eca1992d44ff15d made QWaylandDisplay
@ -337,5 +337,5 @@ index e2593314..73d1eb9c 100644
const QSize screenSize(640, 480);
const uint maximizedSerial = exec([=] {
--
2.33.1
2.35.1

View File

@ -1,7 +1,7 @@
From 992833ca741efe8f533c61abfaf129a1d8bfcfee Mon Sep 17 00:00:00 2001
From: Jan Grulich <jgrulich@redhat.com>
Date: Fri, 16 Jul 2021 13:00:03 +0200
Subject: [PATCH 36/36] Client: do not empty clipboard when a new popup/window
Subject: [PATCH 36/52] 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 ae045f4f..514457e9 100644
mRepeatTimer.stop();
}
--
2.33.1
2.35.1

View File

@ -1,7 +1,7 @@
From eb422ab5e07498a7a8d086f6a942ee35ab3c9776 Mon Sep 17 00:00:00 2001
From: Aleix Pol <aleixpol@kde.org>
Date: Thu, 9 Dec 2021 17:35:24 +0100
Subject: [PATCH 37/41] Fix backport, context destruction was omitted
Subject: [PATCH 37/52] Fix backport, context destruction was omitted
When cherry-picking for 9df11e79b46c77d8c83f765b2a8e85b639fd55a2, this
line got removed when rebasing the patch, which created a leak.
@ -25,5 +25,5 @@ index 95d1049c..683fe123 100644
eglDestroyContext(m_eglDisplay, m_decorationsContext);
}
--
2.34.1
2.35.1

View File

@ -1,7 +1,7 @@
From e0646f531e1e73a90a93faaa45d933ae40769985 Mon Sep 17 00:00:00 2001
From: Weng Xuetian <wengxt@gmail.com>
Date: Sat, 18 Dec 2021 23:42:49 -0800
Subject: [PATCH 38/41] Set preedit cursor when cursor equals to 0
Subject: [PATCH 38/52] 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.34.1
2.35.1

View File

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

View File

@ -1,7 +1,7 @@
From 0b15df7e9e26a4edfc2277eb3ec7b3d5c58a5dcd Mon Sep 17 00:00:00 2001
From: Arjen Hiemstra <ahiemstra@heimr.nl>
Date: Thu, 18 Nov 2021 13:05:30 +0100
Subject: [PATCH 40/44] Client: Delay deletion of QDrag object until after
Subject: [PATCH 40/52] 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.34.1
2.35.1

View File

@ -1,7 +1,7 @@
From 867540b9d913760a847ff67c8694d817c821f2c2 Mon Sep 17 00:00:00 2001
From: David Edmundson <davidedmundson@kde.org>
Date: Sun, 14 Nov 2021 13:54:19 +0000
Subject: [PATCH 41/44] Client: Avoid processing of events when showing windows
Subject: [PATCH 41/52] 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
@ -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.34.1
2.35.1

View File

@ -1,7 +1,7 @@
From bc5a8d24f63181a36759723a4d1b39b59b3b53e6 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 42/44] Handle registry_global out of constructor
Subject: [PATCH 42/52] 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.34.1
2.35.1

View File

@ -1,7 +1,7 @@
From 98dc33fdc66f15a0e69f3024fcef046f11adc58c 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 43/44] Connect flushRequest after forceRoundTrip
Subject: [PATCH 43/52] 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.34.1
2.35.1

View File

@ -1,7 +1,7 @@
From 4644d51f4b52e83fc1b4d02b380d80d9d57e76fa 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 44/44] Move the wayland socket polling to a separate event
Subject: [PATCH 44/52] Move the wayland socket polling to a separate event
thread
New event threads is introduced which calls poll() on the wayland fd,
@ -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.34.1
2.35.1

View File

@ -0,0 +1,30 @@
From 460a2bb54d8377586dff6d561646f3929c71370d 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 45/52] Check pointer for null before use in ASSERT
Task-number: QTBUG-85195
Change-Id: I331e54f6e58aa9d536351a55223610c60b3cb414
Reviewed-by: David Edmundson <davidedmundson@kde.org>
(cherry picked from commit e235e8ddb1fc3cc5ab3b70b1fb285770b2c8c9ca)
---
src/client/qwaylandwindow.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp
index 7de19a74..ac01dc05 100644
--- a/src/client/qwaylandwindow.cpp
+++ b/src/client/qwaylandwindow.cpp
@@ -552,8 +552,8 @@ void QWaylandWindow::sendRecursiveExposeEvent()
void QWaylandWindow::attach(QWaylandBuffer *buffer, int x, int y)
{
- Q_ASSERT(!buffer->committed());
if (buffer) {
+ Q_ASSERT(!buffer->committed());
handleUpdate();
buffer->setBusy();
--
2.35.1

View File

@ -0,0 +1,39 @@
From b6d85c2a75f5618e87267f5b5c361455be257a17 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 46/52] Do not create decorations when the shellSurface is not
ready
A cases reported that client windows try to make decorations
when their shell surfaces are null.
Since the surfaces' requests for decorations should be applied,
those case will be failed to create decorations.
This patch was modified by Paul Tvete's advice.
(paul.tvete@qt.io)
Pick-to: 6.2 5.15
Task-number: QTBUG-97608
Change-Id: I2563dbd73b730f81cc411857af07da99ceb2d063
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
(cherry picked from commit 246f0c0bc01dd059bf8165e81f7b49efa36e4d95)
---
src/client/qwaylandwindow.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp
index ac01dc05..acfe390e 100644
--- a/src/client/qwaylandwindow.cpp
+++ b/src/client/qwaylandwindow.cpp
@@ -813,7 +813,7 @@ bool QWaylandWindow::createDecoration()
decoration = false;
if (mSubSurfaceWindow)
decoration = false;
- if (mShellSurface && !mShellSurface->wantsDecorations())
+ if (!mShellSurface || !mShellSurface->wantsDecorations())
decoration = false;
bool hadDecoration = mWindowDecoration;
--
2.35.1

View File

@ -0,0 +1,131 @@
From 7200a1ad8488f157ef8ce9d5ed81a0a1c1cd1eda 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 47/52] Use wl_surface.damage_buffer on the client side
Prefer the newer, recommended damage_buffer when the compositor
supports it.
Fixes: QTBUG-74929
Change-Id: I9107966910b616a666931404a7b41bfac14c22c0
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
(cherry picked from commit 314fd6db51277224cdc799b039ef79db1101f5cd)
---
src/client/qwaylanddisplay.cpp | 2 +-
src/client/qwaylandwindow.cpp | 16 +++++++++++++---
tests/auto/client/shared/coreprotocol.h | 2 +-
tests/auto/client/shared_old/mockcompositor.cpp | 2 +-
tests/auto/client/shared_old/mocksurface.cpp | 10 ++++++++++
tests/auto/client/shared_old/mocksurface.h | 2 ++
6 files changed, 28 insertions(+), 6 deletions(-)
diff --git a/src/client/qwaylanddisplay.cpp b/src/client/qwaylanddisplay.cpp
index a7ce280a..6f1bada5 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
if (interface == QStringLiteral("wl_output")) {
mWaitingScreens << new QWaylandScreen(this, version, id);
} else if (interface == QStringLiteral("wl_compositor")) {
- mCompositorVersion = qMin((int)version, 3);
+ mCompositorVersion = qMin((int)version, 4);
mCompositor.init(registry, id, mCompositorVersion);
} 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
--- a/src/client/qwaylandwindow.cpp
+++ b/src/client/qwaylandwindow.cpp
@@ -571,7 +571,11 @@ void QWaylandWindow::attachOffset(QWaylandBuffer *buffer)
void QWaylandWindow::damage(const QRect &rect)
{
- mSurface->damage(rect.x(), rect.y(), rect.width(), rect.height());
+ const int s = scale();
+ if (mDisplay->compositorVersion() >= 4)
+ mSurface->damage_buffer(s * rect.x(), s * rect.y(), s * rect.width(), s * rect.height());
+ else
+ mSurface->damage(rect.x(), rect.y(), rect.width(), rect.height());
}
void QWaylandWindow::safeCommit(QWaylandBuffer *buffer, const QRegion &damage)
@@ -605,8 +609,14 @@ void QWaylandWindow::commit(QWaylandBuffer *buffer, const QRegion &damage)
return;
attachOffset(buffer);
- for (const QRect &rect: damage)
- mSurface->damage(rect.x(), rect.y(), rect.width(), rect.height());
+ if (mDisplay->compositorVersion() >= 4) {
+ const int s = scale();
+ for (const QRect &rect: damage)
+ mSurface->damage_buffer(s * rect.x(), s * rect.y(), s * rect.width(), s * rect.height());
+ } else {
+ for (const QRect &rect: damage)
+ mSurface->damage(rect.x(), rect.y(), rect.width(), rect.height());
+ }
Q_ASSERT(!buffer->committed());
buffer->setCommitted();
mSurface->commit();
diff --git a/tests/auto/client/shared/coreprotocol.h b/tests/auto/client/shared/coreprotocol.h
index a1af137a..296dbf47 100644
--- a/tests/auto/client/shared/coreprotocol.h
+++ b/tests/auto/client/shared/coreprotocol.h
@@ -158,7 +158,7 @@ class WlCompositor : public Global, public QtWaylandServer::wl_compositor
{
Q_OBJECT
public:
- explicit WlCompositor(CoreCompositor *compositor, int version = 3)
+ explicit WlCompositor(CoreCompositor *compositor, int version = 4)
: QtWaylandServer::wl_compositor(compositor->m_display, version)
, m_compositor(compositor)
{}
diff --git a/tests/auto/client/shared_old/mockcompositor.cpp b/tests/auto/client/shared_old/mockcompositor.cpp
index a415cbf5..b1d3d07d 100644
--- a/tests/auto/client/shared_old/mockcompositor.cpp
+++ b/tests/auto/client/shared_old/mockcompositor.cpp
@@ -342,7 +342,7 @@ Compositor::Compositor(MockCompositor *mockCompositor)
exit(EXIT_FAILURE);
}
- wl_global_create(m_display, &wl_compositor_interface, 1, this, bindCompositor);
+ wl_global_create(m_display, &wl_compositor_interface, 4, this, bindCompositor);
m_data_device_manager.reset(new DataDeviceManager(this, m_display));
diff --git a/tests/auto/client/shared_old/mocksurface.cpp b/tests/auto/client/shared_old/mocksurface.cpp
index e9df5f90..c3246e4a 100644
--- a/tests/auto/client/shared_old/mocksurface.cpp
+++ b/tests/auto/client/shared_old/mocksurface.cpp
@@ -125,6 +125,16 @@ void Surface::surface_damage(Resource *resource,
Q_UNUSED(height);
}
+void Surface::surface_damage_buffer(Resource *resource,
+ int32_t x, int32_t y, int32_t width, int32_t height)
+{
+ Q_UNUSED(resource);
+ Q_UNUSED(x);
+ Q_UNUSED(y);
+ Q_UNUSED(width);
+ Q_UNUSED(height);
+}
+
void Surface::surface_frame(Resource *resource,
uint32_t callback)
{
diff --git a/tests/auto/client/shared_old/mocksurface.h b/tests/auto/client/shared_old/mocksurface.h
index 949dc23d..d176837e 100644
--- a/tests/auto/client/shared_old/mocksurface.h
+++ b/tests/auto/client/shared_old/mocksurface.h
@@ -65,6 +65,8 @@ protected:
struct wl_resource *buffer, int x, int y) override;
void surface_damage(Resource *resource,
int32_t x, int32_t y, int32_t width, int32_t height) override;
+ void surface_damage_buffer(Resource *resource,
+ int32_t x, int32_t y, int32_t width, int32_t height) override;
void surface_frame(Resource *resource,
uint32_t callback) override;
void surface_commit(Resource *resource) override;
--
2.35.1

View File

@ -0,0 +1,29 @@
From ce2caf493a1343fbd9f8e4c85baf6a61c057f242 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 48/52] Fix crash if no input method module could be loaded
Pick-to: 6.2 6.3 5.15
Change-Id: I8f346def616606a6c5540856bd08a84ee7ed5ca2
Reviewed-by: David Edmundson <davidedmundson@kde.org>
(cherry picked from commit 49fb7248f6ab7de046e2179c7861951ea1169e9b)
---
src/client/qwaylandintegration.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/client/qwaylandintegration.cpp b/src/client/qwaylandintegration.cpp
index 3b876047..fbf00c6b 100644
--- a/src/client/qwaylandintegration.cpp
+++ b/src/client/qwaylandintegration.cpp
@@ -491,7 +491,7 @@ void QWaylandIntegration::reconfigureInputContext()
}
#endif
- qCDebug(lcQpaWayland) << "using input method:" << inputContext()->metaObject()->className();
+ qCDebug(lcQpaWayland) << "using input method:" << (inputContext() ? inputContext()->metaObject()->className() : "<none>");
}
QWaylandShellIntegration *QWaylandIntegration::createShellIntegration(const QString &integrationName)
--
2.35.1

View File

@ -0,0 +1,79 @@
From 214f7ab9d3384a4123f14d9f6cd0205cf0aaa794 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 49/52] Client: Remove mWaitingForUpdateDelivery
Currently, mWaitingForUpdateDelivery is shared between the main thread
(doHandleFrameCallback()) and the frame callback event thread
(handleFrameCallback()), however the access to it is not synchronized
between both threads. On the other hand, QWaylandWindow
already ensures not to create a frame callback if there's already one
pending.
This change removes mWaitingForUpdateDelivery flag because it should be
already covered by mWaitingForFrameCallback and to remove unsynchronized
shared state between threads.
Change-Id: I0e5a25d18d1e66c4d7683e7e972330c4d7cbbf38
Reviewed-by: David Edmundson <davidedmundson@kde.org>
(cherry picked from commit feb1a5c207c13d0bf87c0d8ad039279dbf8cee9e)
---
src/client/qwaylandwindow.cpp | 29 ++++++++++++-----------------
src/client/qwaylandwindow_p.h | 1 -
2 files changed, 12 insertions(+), 18 deletions(-)
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp
index 4c5711a0..949374b1 100644
--- a/src/client/qwaylandwindow.cpp
+++ b/src/client/qwaylandwindow.cpp
@@ -648,23 +648,18 @@ void QWaylandWindow::handleFrameCallback()
mFrameCallbackElapsedTimer.invalidate();
// The rest can wait until we can run it on the correct thread
- if (!mWaitingForUpdateDelivery) {
- auto doHandleExpose = [this]() {
- bool wasExposed = isExposed();
- mFrameCallbackTimedOut = false;
- if (!wasExposed && isExposed()) // Did setting mFrameCallbackTimedOut make the window exposed?
- sendExposeEvent(QRect(QPoint(), geometry().size()));
- if (wasExposed && hasPendingUpdateRequest())
- deliverUpdateRequest();
-
- mWaitingForUpdateDelivery = false;
- };
-
- // Queued connection, to make sure we don't call handleUpdate() from inside waitForFrameSync()
- // in the single-threaded case.
- mWaitingForUpdateDelivery = true;
- QMetaObject::invokeMethod(this, doHandleExpose, Qt::QueuedConnection);
- }
+ auto doHandleExpose = [this]() {
+ bool wasExposed = isExposed();
+ mFrameCallbackTimedOut = false;
+ if (!wasExposed && isExposed()) // Did setting mFrameCallbackTimedOut make the window exposed?
+ sendExposeEvent(QRect(QPoint(), geometry().size()));
+ if (wasExposed && hasPendingUpdateRequest())
+ deliverUpdateRequest();
+ };
+
+ // Queued connection, to make sure we don't call handleUpdate() from inside waitForFrameSync()
+ // in the single-threaded case.
+ QMetaObject::invokeMethod(this, doHandleExpose, Qt::QueuedConnection);
mFrameSyncWait.notify_all();
}
diff --git a/src/client/qwaylandwindow_p.h b/src/client/qwaylandwindow_p.h
index d45980a8..3ff68ccb 100644
--- a/src/client/qwaylandwindow_p.h
+++ b/src/client/qwaylandwindow_p.h
@@ -228,7 +228,6 @@ protected:
WId mWindowId;
bool mWaitingForFrameCallback = false;
bool mFrameCallbackTimedOut = false; // Whether the frame callback has timed out
- bool mWaitingForUpdateDelivery = false;
int mFrameCallbackCheckIntervalTimerId = -1;
QElapsedTimer mFrameCallbackElapsedTimer;
struct ::wl_callback *mFrameCallback = nullptr;
--
2.35.1

View File

@ -0,0 +1,35 @@
From 157c7f55005a6ef0e65ebb02f9b5f344848670b2 Mon Sep 17 00:00:00 2001
From: Weng Xuetian <wengxt@gmail.com>
Date: Tue, 8 Feb 2022 07:11:25 -0800
Subject: [PATCH 50/52] Cursor position == 0 should still show the cursor
Otherwise the cursor would be hidden even if preedit is empty.
Amends 719a55be13bdadfa659a732755f280e276a894bd
Pick-to: 5.15 6.2 6.3
Change-Id: I320733b917779b7b51aa4a28eaea411fdb10a318
Reviewed-by: Liang Qi <liang.qi@qt.io>
(cherry picked from commit 31ae194e295651d9ece03408630d2358acd4f7b4)
---
src/shared/qwaylandinputmethodeventbuilder.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/shared/qwaylandinputmethodeventbuilder.cpp b/src/shared/qwaylandinputmethodeventbuilder.cpp
index 25be2509..458d818e 100644
--- a/src/shared/qwaylandinputmethodeventbuilder.cpp
+++ b/src/shared/qwaylandinputmethodeventbuilder.cpp
@@ -151,9 +151,9 @@ QInputMethodEvent QWaylandInputMethodEventBuilder::buildPreedit(const QString &t
{
QList<QInputMethodEvent::Attribute> attributes;
- if (m_preeditCursor <= 0) {
+ if (m_preeditCursor < 0) {
attributes.append(QInputMethodEvent::Attribute(QInputMethodEvent::Cursor, 0, 0, QVariant()));
- } else if (m_preeditCursor > 0) {
+ } else {
attributes.append(QInputMethodEvent::Attribute(QInputMethodEvent::Cursor, indexFromWayland(text, m_preeditCursor), 1, QVariant()));
}
--
2.35.1

View File

@ -0,0 +1,88 @@
From 9f66cd3784421ee5dc6538630ade0cf215f656aa Mon Sep 17 00:00:00 2001
From: Weng Xuetian <wengxt@gmail.com>
Date: Wed, 22 Dec 2021 10:42:38 -0800
Subject: [PATCH 51/52] Update the preedit styling mapping
- None mapping to no style.
- Default/Underline mapping to underline.
- Highlight/Selection mapping to background color/text color with highlight/highlight
text with underline.
- Active/Inactive mapping to bold text with underline.
- Incorrect mapping to red wave underline.
Pick-to: 5.15 6.2 6.3
Change-Id: Iab51d671b8f83aece8596f7f7610de19343fcceb
Reviewed-by: Aleix Pol Gonzalez <aleixpol@kde.org>
(cherry picked from commit f1fb5d9e568a24e213ee41e82a1142cef56f1098)
---
.../qwaylandinputmethodeventbuilder.cpp | 31 ++++++++++++-------
1 file changed, 20 insertions(+), 11 deletions(-)
diff --git a/src/shared/qwaylandinputmethodeventbuilder.cpp b/src/shared/qwaylandinputmethodeventbuilder.cpp
index 458d818e..f50ccf30 100644
--- a/src/shared/qwaylandinputmethodeventbuilder.cpp
+++ b/src/shared/qwaylandinputmethodeventbuilder.cpp
@@ -39,7 +39,10 @@
#include "qwaylandinputmethodeventbuilder_p.h"
+#include <QBrush>
+#include <QGuiApplication>
#include <QInputMethod>
+#include <QPalette>
#include <QTextCharFormat>
#ifdef QT_BUILD_WAYLANDCOMPOSITOR_LIB
@@ -81,32 +84,38 @@ void QWaylandInputMethodEventBuilder::addPreeditStyling(uint32_t index, uint32_t
QTextCharFormat format;
switch (style) {
- case 0:
- case 1:
+ case ZWP_TEXT_INPUT_V2_PREEDIT_STYLE_NONE:
+ break;
+ case ZWP_TEXT_INPUT_V2_PREEDIT_STYLE_DEFAULT:
+ case ZWP_TEXT_INPUT_V2_PREEDIT_STYLE_UNDERLINE:
format.setFontUnderline(true);
format.setUnderlineStyle(QTextCharFormat::SingleUnderline);
m_preeditStyles.append(QInputMethodEvent::Attribute(QInputMethodEvent::TextFormat, index, length, format));
break;
- case 2:
- case 3:
+ case ZWP_TEXT_INPUT_V2_PREEDIT_STYLE_ACTIVE:
+ case ZWP_TEXT_INPUT_V2_PREEDIT_STYLE_INACTIVE:
format.setFontWeight(QFont::Bold);
format.setFontUnderline(true);
format.setUnderlineStyle(QTextCharFormat::SingleUnderline);
m_preeditStyles.append(QInputMethodEvent::Attribute(QInputMethodEvent::TextFormat, index, length, format));
break;
- case 4:
- format.setFontUnderline(true);
- format.setUnderlineStyle(QTextCharFormat::SingleUnderline);
- m_preeditStyles.append(QInputMethodEvent::Attribute(QInputMethodEvent::TextFormat, index, length, format));
+ case ZWP_TEXT_INPUT_V2_PREEDIT_STYLE_HIGHLIGHT:
+ case ZWP_TEXT_INPUT_V2_PREEDIT_STYLE_SELECTION:
+ {
+ format.setFontUnderline(true);
+ format.setUnderlineStyle(QTextCharFormat::SingleUnderline);
+ QPalette palette = qApp->palette();
+ format.setBackground(QBrush(palette.color(QPalette::Active, QPalette::Highlight)));
+ format.setForeground(QBrush(palette.color(QPalette::Active, QPalette::HighlightedText)));
+ m_preeditStyles.append(QInputMethodEvent::Attribute(QInputMethodEvent::TextFormat, index, length, format));
+ }
break;
- case 5:
+ case ZWP_TEXT_INPUT_V2_PREEDIT_STYLE_INCORRECT:
format.setFontUnderline(true);
format.setUnderlineStyle(QTextCharFormat::WaveUnderline);
format.setUnderlineColor(QColor(Qt::red));
m_preeditStyles.append(QInputMethodEvent::Attribute(QInputMethodEvent::TextFormat, index, length, format));
break;
-// case QtWayland::wl_text_input::preedit_style_selection:
-// case QtWayland::wl_text_input::preedit_style_none:
default:
break;
}
--
2.35.1

View File

@ -0,0 +1,82 @@
From d6a6b727832819d118199f7016c2c401663ee370 Mon Sep 17 00:00:00 2001
From: David Edmundson <davidedmundson@kde.org>
Date: Wed, 9 Feb 2022 17:20:48 +0000
Subject: [PATCH 52/52] client: Simplify round trip behavior
The custom event queue was removed in
302d4ffb8549214eb4028dc3e47ec4ee4e12ffbd (2015) so the comment about not
being able to use the inbuilt round trip method no longer applies.
This fixes a real world problem. Use of a blocking round trip should not
process non wayland events. Doing so can lead to misbehaviour client
side as things happen out of order. The move to the event thread created
several regressions as we now get events before the QGuiApplication is
fully constructed.
Change-Id: I650481f49a47ed1a9778c7e1bc3c48db6e8f0031
Reviewed-by: Vlad Zahorodnii <vlad.zahorodnii@kde.org>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
(cherry picked from commit 62646d9122845d7bd9104b610478cebde3e769c7)
---
src/client/qwaylanddisplay.cpp | 43 +---------------------------------
1 file changed, 1 insertion(+), 42 deletions(-)
diff --git a/src/client/qwaylanddisplay.cpp b/src/client/qwaylanddisplay.cpp
index 6f1bada5..86045a35 100644
--- a/src/client/qwaylanddisplay.cpp
+++ b/src/client/qwaylanddisplay.cpp
@@ -611,50 +611,9 @@ uint32_t QWaylandDisplay::currentTimeMillisec()
return 0;
}
-static void
-sync_callback(void *data, struct wl_callback *callback, uint32_t serial)
-{
- Q_UNUSED(serial)
- bool *done = static_cast<bool *>(data);
-
- *done = true;
-
- // If the wl_callback done event is received after the condition check in the while loop in
- // forceRoundTrip(), but before the call to processEvents, the call to processEvents may block
- // forever if no more events are posted (eventhough the callback is handled in response to the
- // aboutToBlock signal). Hence, we wake up the event dispatcher so forceRoundTrip may return.
- // (QTBUG-64696)
- if (auto *dispatcher = QThread::currentThread()->eventDispatcher())
- dispatcher->wakeUp();
-
- wl_callback_destroy(callback);
-}
-
-static const struct wl_callback_listener sync_listener = {
- sync_callback
-};
-
void QWaylandDisplay::forceRoundTrip()
{
- // wl_display_roundtrip() works on the main queue only,
- // but we use a separate one, so basically reimplement it here
- int ret = 0;
- bool done = false;
- wl_callback *callback = wl_display_sync(mDisplay);
- wl_callback_add_listener(callback, &sync_listener, &done);
- flushRequests();
- if (QThread::currentThread()->eventDispatcher()) {
- while (!done && ret >= 0) {
- QThread::currentThread()->eventDispatcher()->processEvents(QEventLoop::WaitForMoreEvents);
- ret = wl_display_dispatch_pending(mDisplay);
- }
- } else {
- while (!done && ret >= 0)
- ret = wl_display_dispatch(mDisplay);
- }
-
- if (ret == -1 && !done)
- wl_callback_destroy(callback);
+ wl_display_roundtrip(mDisplay);
}
bool QWaylandDisplay::supportsWindowDecoration() const
--
2.35.1

View File

@ -5,7 +5,7 @@
Summary: Qt5 - Wayland platform support and QtCompositor module
Name: qt5-%{qt_module}
Version: 5.15.2
Release: 14%{?dist}
Release: 15%{?dist}
License: LGPLv3
Url: http://www.qt.io
@ -61,6 +61,14 @@ Patch41: 0041-Client-Avoid-processing-of-events-when-showing-windo.patch
Patch42: 0042-Handle-registry_global-out-of-constructor.patch
Patch43: 0043-Connect-flushRequest-after-forceRoundTrip.patch
Patch44: 0044-Move-the-wayland-socket-polling-to-a-separate-event-.patch
Patch45: 0045-Check-pointer-for-null-before-use-in-ASSERT.patch
Patch46: 0046-Do-not-create-decorations-when-the-shellSurface-is-n.patch
Patch47: 0047-Use-wl_surface.damage_buffer-on-the-client-side.patch
Patch48: 0048-Fix-crash-if-no-input-method-module-could-be-loaded.patch
Patch49: 0049-Client-Remove-mWaitingForUpdateDelivery.patch
Patch50: 0050-Cursor-position-0-should-still-show-the-cursor.patch
Patch51: 0051-Update-the-preedit-styling-mapping.patch
Patch52: 0052-client-Simplify-round-trip-behavior.patch
# Disable for now, there is a Qt bug making this broken
# Patch52: qtwayland-decoration-support-backports-from-qt6.patch
@ -190,6 +198,10 @@ popd
%endif
%changelog
* Tue Feb 15 2022 Jan Grulich <jgrulich@redhat.com> - 5.15.2-15
- Sync with Fedora
Resolves: bz#2051384
* Mon Jan 24 2022 Jan Grulich <jgrulich@redhat.com> - 5.15.2-14
- Sync with Fedora
Resolves: bz#2044169