Gentoo Archives: gentoo-commits

From: Andreas Sturmlechner <asturm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: kde-frameworks/kwindowsystem/files/, kde-frameworks/kwindowsystem/
Date: Thu, 20 Jan 2022 13:26:46
Message-Id: 1642685060.e5d9cd231e551b2b117dbe5bd742c1bbd5a97701.asturm@gentoo
1 commit: e5d9cd231e551b2b117dbe5bd742c1bbd5a97701
2 Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
3 AuthorDate: Thu Jan 20 12:34:19 2022 +0000
4 Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
5 CommitDate: Thu Jan 20 13:24:20 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e5d9cd23
7
8 kde-frameworks/kwindowsystem: Fix swapping Alt with Win behavior
9
10 Upstream commit 6e3d645d444073097e93520f047bb2321673119a
11 KDE-bug: https://bugs.kde.org/show_bug.cgi?id=426684
12 Package-Manager: Portage-3.0.30, Repoman-3.0.3
13 Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>
14
15 ...indowsystem-5.90.0-avoid-XKeycodeToKeysym.patch | 50 ++++++++++++++++++++++
16 .../kwindowsystem/kwindowsystem-5.90.0-r1.ebuild | 46 ++++++++++++++++++++
17 2 files changed, 96 insertions(+)
18
19 diff --git a/kde-frameworks/kwindowsystem/files/kwindowsystem-5.90.0-avoid-XKeycodeToKeysym.patch b/kde-frameworks/kwindowsystem/files/kwindowsystem-5.90.0-avoid-XKeycodeToKeysym.patch
20 new file mode 100644
21 index 000000000000..a9f47883e6e8
22 --- /dev/null
23 +++ b/kde-frameworks/kwindowsystem/files/kwindowsystem-5.90.0-avoid-XKeycodeToKeysym.patch
24 @@ -0,0 +1,50 @@
25 +From 6e3d645d444073097e93520f047bb2321673119a Mon Sep 17 00:00:00 2001
26 +From: Fabian Vogt <fabian@×××××××××××.de>
27 +Date: Sun, 2 Jan 2022 23:52:07 +0100
28 +Subject: [PATCH] Avoid XKeycodeToKeysym in KKeyServer::initializeMods
29 +
30 +Xlib functions which work with keyboard mappings have a (Display) internal
31 +cache, which needs to be refreshed on mapping changes by calling
32 +X(kb)RefreshKeyboardMapping on change notify events.
33 +
34 +After Qt switched to XCB, that is no longer happening, and it's also not
35 +possible to get to the XEvent needed for triggering the refresh. Switch
36 +over to using the XCB equivalent and just load the symbols on every invocation.
37 +
38 +BUG: 426684
39 +---
40 + src/platforms/xcb/kkeyserver.cpp | 4 +++-
41 + 1 file changed, 3 insertions(+), 1 deletion(-)
42 +
43 +diff --git a/src/platforms/xcb/kkeyserver.cpp b/src/platforms/xcb/kkeyserver.cpp
44 +index 306c63b..bc43dbd 100644
45 +--- a/src/platforms/xcb/kkeyserver.cpp
46 ++++ b/src/platforms/xcb/kkeyserver.cpp
47 +@@ -496,6 +496,7 @@ bool initializeMods()
48 + }
49 +
50 + checkDisplay();
51 ++ xcb_key_symbols_t *symbols = xcb_key_symbols_alloc(QX11Info::connection());
52 + XModifierKeymap *xmk = XGetModifierMapping(QX11Info::display());
53 +
54 + int min_keycode;
55 +@@ -515,7 +516,7 @@ bool initializeMods()
56 + // found fixes the problem.
57 + for (int j = 0; j < xmk->max_keypermod; ++j) {
58 + for (int k = 0; k < keysyms_per_keycode; ++k) {
59 +- keySymX = XKeycodeToKeysym(QX11Info::display(), xmk->modifiermap[xmk->max_keypermod * i + j], k);
60 ++ keySymX = xcb_key_symbols_get_keysym(symbols, xmk->modifiermap[xmk->max_keypermod * i + j], k);
61 +
62 + switch (keySymX) {
63 + case XK_Alt_L:
64 +@@ -628,6 +629,7 @@ bool initializeMods()
65 + g_rgX11ModInfo[2].modX = g_alt_mask;
66 + g_rgX11ModInfo[3].modX = g_meta_mask;
67 +
68 ++ xcb_key_symbols_free(symbols);
69 + XFreeModifiermap(xmk);
70 + g_bInitializedMods = true;
71 +
72 +--
73 +GitLab
74 +
75
76 diff --git a/kde-frameworks/kwindowsystem/kwindowsystem-5.90.0-r1.ebuild b/kde-frameworks/kwindowsystem/kwindowsystem-5.90.0-r1.ebuild
77 new file mode 100644
78 index 000000000000..9b74f0ae66e9
79 --- /dev/null
80 +++ b/kde-frameworks/kwindowsystem/kwindowsystem-5.90.0-r1.ebuild
81 @@ -0,0 +1,46 @@
82 +# Copyright 1999-2022 Gentoo Authors
83 +# Distributed under the terms of the GNU General Public License v2
84 +
85 +EAPI=8
86 +
87 +QTMIN=5.15.2
88 +VIRTUALX_REQUIRED="test"
89 +inherit ecm kde.org
90 +
91 +DESCRIPTION="Framework providing access to properties and features of the window manager"
92 +LICENSE="|| ( LGPL-2.1 LGPL-3 ) MIT"
93 +KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~riscv ~x86"
94 +IUSE="nls X"
95 +
96 +RESTRICT="test"
97 +
98 +RDEPEND="
99 + >=dev-qt/qtgui-${QTMIN}:5
100 + X? (
101 + >=dev-qt/qtx11extras-${QTMIN}:5
102 + x11-libs/libX11
103 + x11-libs/libXfixes
104 + x11-libs/libxcb
105 + x11-libs/xcb-util-keysyms
106 + )
107 +"
108 +DEPEND="${RDEPEND}
109 + X? ( x11-base/xorg-proto )
110 + test? ( >=dev-qt/qtwidgets-${QTMIN}:5 )
111 +"
112 +BDEPEND="
113 + nls? ( >=dev-qt/linguist-tools-${QTMIN}:5 )
114 +"
115 +
116 +DOCS=( docs/README.kstartupinfo )
117 +
118 +PATCHES=( "${FILESDIR}/${P}-avoid-XKeycodeToKeysym.patch" ) # KDE-bug 426684
119 +
120 +src_configure() {
121 + local mycmakeargs=(
122 + -DKWINDOWSYSTEM_NO_WIDGETS=ON
123 + $(cmake_use_find_package X X11)
124 + )
125 +
126 + ecm_src_configure
127 +}