Backport upstream fix: Fix Qt::KeypadModifier for key events

This commit is contained in:
Jan Grulich 2024-02-08 11:11:01 +01:00
parent 64673fbfc9
commit 536e35b8ee
2 changed files with 40 additions and 1 deletions

View File

@ -11,7 +11,7 @@
Summary: Qt6 - Wayland platform support and QtCompositor module Summary: Qt6 - Wayland platform support and QtCompositor module
Name: qt6-%{qt_module} Name: qt6-%{qt_module}
Version: 6.6.1 Version: 6.6.1
Release: 4%{?dist} Release: 5%{?dist}
License: LGPL-3.0-only OR GPL-3.0-only WITH Qt-GPL-exception-1.0 License: LGPL-3.0-only OR GPL-3.0-only WITH Qt-GPL-exception-1.0
Url: http://www.qt.io Url: http://www.qt.io
@ -26,6 +26,7 @@ Source0: https://download.qt.io/official_releases/qt/%{majmin}/%{version}/submod
# Upstream patches # Upstream patches
Patch0: qtwayland-client-disable-threaded-gl-on-desktop-nvidia.patch Patch0: qtwayland-client-disable-threaded-gl-on-desktop-nvidia.patch
Patch1: qtwayland-client-fix-qt-keypadmodifier-for-key-events.patch
# Upstreamable patches # Upstreamable patches
Patch10: qtwayland-use-adwaita-decorations-by-default.patch Patch10: qtwayland-use-adwaita-decorations-by-default.patch
@ -174,6 +175,9 @@ popd
%endif %endif
%changelog %changelog
* Thu Feb 08 2024 Jan Grulich <jgrulich@redhat.com> - 6.6.1-5
- Backport upstream fix: Fix Qt::KeypadModifier for key events
* Wed Feb 07 2024 Jan Grulich <jgrulich@redhat.com> * Wed Feb 07 2024 Jan Grulich <jgrulich@redhat.com>
- Backport upstream fix: disable threaded GL on desktop NVIDIA - Backport upstream fix: disable threaded GL on desktop NVIDIA

View File

@ -0,0 +1,35 @@
From e0796865151b06dddc5c5665f9ca8bdc8021fcd8 Mon Sep 17 00:00:00 2001
From: Nicolas Fella <nicolas.fella@kde.org>
Date: Wed, 24 Jan 2024 01:39:24 +0100
Subject: [PATCH] Client: Fix Qt::KeypadModifier for key events
Use the right QXkbCommon::modifiers overload that can resolve the
modifier.
f614fdfa5dc522f805c7c061535df6a0dc7409b9 did this for wayland-server,
do the same for the client side
Pick-to: 6.5
Change-Id: Iff0c105cb31201241d4972a7772cf997cede3fc3
Reviewed-by: Liang Qi <liang.qi@qt.io>
(cherry picked from commit 17e46725c5971a3067d5abd5506fde6c03d0935f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit bec69733f67e65de456e63db600f4e871ae2b53b)
---
src/client/qwaylandinputdevice.cpp | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/client/qwaylandinputdevice.cpp b/src/client/qwaylandinputdevice.cpp
index a4f8757e3..8d6ebba08 100644
--- a/src/client/qwaylandinputdevice.cpp
+++ b/src/client/qwaylandinputdevice.cpp
@@ -1335,8 +1335,7 @@ void QWaylandInputDevice::Keyboard::keyboard_key(uint32_t serial, uint32_t time,
auto code = key + 8; // map to wl_keyboard::keymap_format::keymap_format_xkb_v1
xkb_keysym_t sym = xkb_state_key_get_one_sym(mXkbState.get(), code);
-
- Qt::KeyboardModifiers modifiers = mParent->modifiers();
+ Qt::KeyboardModifiers modifiers = QXkbCommon::modifiers(mXkbState.get(), sym);
int qtkey = keysymToQtKey(sym, modifiers, mXkbState.get(), code);
QString text = QXkbCommon::lookupString(mXkbState.get(), code);