Update clipboard patch

This commit is contained in:
Jan Grulich 2021-10-04 19:48:15 +02:00
parent 9349ec2adf
commit e23461a6d4
2 changed files with 15 additions and 15 deletions

View File

@ -3,7 +3,7 @@
Summary: Qt5 - Wayland platform support and QtCompositor module
Name: qt5-%{qt_module}
Version: 5.15.2
Release: 13%{?dist}
Release: 14%{?dist}
License: LGPLv3
Url: http://www.qt.io
@ -164,6 +164,9 @@ popd
%changelog
* Mon Oct 04 2021 Jan Grulich <jgrulich@redhat.com> - 5.15.2-14
- Update clipboard patch
* Mon Oct 04 2021 Jan Grulich <jgrulich@redhat.com> - 5.15.2-13
- Backport clipboard fixes
Resolves: bz#1957503

View File

@ -14,28 +14,25 @@ Change-Id: Ia2ef826c2967b1daf1cdeb085e8dae66d090dbcf
---
diff --git a/src/client/qwaylanddisplay.cpp b/src/client/qwaylanddisplay.cpp
index 2730311..e05eee5 100644
index 2730311..9f595af 100644
--- a/src/client/qwaylanddisplay.cpp
+++ b/src/client/qwaylanddisplay.cpp
@@ -595,8 +595,21 @@ void QWaylandDisplay::handleWaylandSync()
// pair, and the latter one would be lost in the QWindowSystemInterface queue, if we issue the
// handleWindowActivated() calls immediately.
@@ -597,6 +597,19 @@ void QWaylandDisplay::handleWaylandSync()
QWindow *activeWindow = mActiveWindows.empty() ? nullptr : mActiveWindows.last()->window();
- if (activeWindow != QGuiApplication::focusWindow())
+ if (activeWindow != QGuiApplication::focusWindow()) {
+ if (!activeWindow) {
+ if (lastInputDevice()) {
if (activeWindow != QGuiApplication::focusWindow())
QWindowSystemInterface::handleWindowActivated(activeWindow);
+
+ if (!activeWindow) {
+ if (lastInputDevice()) {
+#if QT_CONFIG(clipboard)
+ if (auto *dataDevice = lastInputDevice()->dataDevice())
+ dataDevice->invalidateSelectionOffer();
+ if (auto *dataDevice = lastInputDevice()->dataDevice())
+ dataDevice->invalidateSelectionOffer();
+#endif
+#if QT_CONFIG(wayland_client_primary_selection)
+ if (auto *device = lastInputDevice()->primarySelectionDevice())
+ device->invalidateSelectionOffer();
+ if (auto *device = lastInputDevice()->primarySelectionDevice())
+ device->invalidateSelectionOffer();
+#endif
+ }
+ }
QWindowSystemInterface::handleWindowActivated(activeWindow);
+ }
}