From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1359599-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits))
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id 8FAD9158088
	for <garchives@archives.gentoo.org>; Thu, 20 Jan 2022 13:26:46 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 970412BC02E;
	Thu, 20 Jan 2022 13:26:38 +0000 (UTC)
Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id 60B82E07D4
	for <gentoo-commits@lists.gentoo.org>; Thu, 20 Jan 2022 13:26:38 +0000 (UTC)
Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id D136E34339B
	for <gentoo-commits@lists.gentoo.org>; Thu, 20 Jan 2022 13:26:36 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id C03822B8
	for <gentoo-commits@lists.gentoo.org>; Thu, 20 Jan 2022 13:26:33 +0000 (UTC)
From: "Andreas Sturmlechner" <asturm@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Andreas Sturmlechner" <asturm@gentoo.org>
Message-ID: <1642685060.e5d9cd231e551b2b117dbe5bd742c1bbd5a97701.asturm@gentoo>
Subject: [gentoo-commits] repo/gentoo:master commit in: kde-frameworks/kwindowsystem/files/, kde-frameworks/kwindowsystem/
X-VCS-Repository: repo/gentoo
X-VCS-Files: kde-frameworks/kwindowsystem/files/kwindowsystem-5.90.0-avoid-XKeycodeToKeysym.patch kde-frameworks/kwindowsystem/kwindowsystem-5.90.0-r1.ebuild
X-VCS-Directories: kde-frameworks/kwindowsystem/ kde-frameworks/kwindowsystem/files/
X-VCS-Committer: asturm
X-VCS-Committer-Name: Andreas Sturmlechner
X-VCS-Revision: e5d9cd231e551b2b117dbe5bd742c1bbd5a97701
X-VCS-Branch: master
Date: Thu, 20 Jan 2022 13:26:33 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
X-Archives-Salt: 43741351-249c-4491-a130-2372fd782272
X-Archives-Hash: ee216d03814f0d799f9281f608bbbf1c

commit:     e5d9cd231e551b2b117dbe5bd742c1bbd5a97701
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Thu Jan 20 12:34:19 2022 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Thu Jan 20 13:24:20 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e5d9cd23

kde-frameworks/kwindowsystem: Fix swapping Alt with Win behavior

Upstream commit 6e3d645d444073097e93520f047bb2321673119a
KDE-bug: https://bugs.kde.org/show_bug.cgi?id=426684
Package-Manager: Portage-3.0.30, Repoman-3.0.3
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 ...indowsystem-5.90.0-avoid-XKeycodeToKeysym.patch | 50 ++++++++++++++++++++++
 .../kwindowsystem/kwindowsystem-5.90.0-r1.ebuild   | 46 ++++++++++++++++++++
 2 files changed, 96 insertions(+)

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
new file mode 100644
index 000000000000..a9f47883e6e8
--- /dev/null
+++ b/kde-frameworks/kwindowsystem/files/kwindowsystem-5.90.0-avoid-XKeycodeToKeysym.patch
@@ -0,0 +1,50 @@
+From 6e3d645d444073097e93520f047bb2321673119a Mon Sep 17 00:00:00 2001
+From: Fabian Vogt <fabian@ritter-vogt.de>
+Date: Sun, 2 Jan 2022 23:52:07 +0100
+Subject: [PATCH] Avoid XKeycodeToKeysym in KKeyServer::initializeMods
+
+Xlib functions which work with keyboard mappings have a (Display) internal
+cache, which needs to be refreshed on mapping changes by calling
+X(kb)RefreshKeyboardMapping on change notify events.
+
+After Qt switched to XCB, that is no longer happening, and it's also not
+possible to get to the XEvent needed for triggering the refresh. Switch
+over to using the XCB equivalent and just load the symbols on every invocation.
+
+BUG: 426684
+---
+ src/platforms/xcb/kkeyserver.cpp | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/src/platforms/xcb/kkeyserver.cpp b/src/platforms/xcb/kkeyserver.cpp
+index 306c63b..bc43dbd 100644
+--- a/src/platforms/xcb/kkeyserver.cpp
++++ b/src/platforms/xcb/kkeyserver.cpp
+@@ -496,6 +496,7 @@ bool initializeMods()
+     }
+ 
+     checkDisplay();
++    xcb_key_symbols_t *symbols = xcb_key_symbols_alloc(QX11Info::connection());
+     XModifierKeymap *xmk = XGetModifierMapping(QX11Info::display());
+ 
+     int min_keycode;
+@@ -515,7 +516,7 @@ bool initializeMods()
+         // found fixes the problem.
+         for (int j = 0; j < xmk->max_keypermod; ++j) {
+             for (int k = 0; k < keysyms_per_keycode; ++k) {
+-                keySymX = XKeycodeToKeysym(QX11Info::display(), xmk->modifiermap[xmk->max_keypermod * i + j], k);
++                keySymX = xcb_key_symbols_get_keysym(symbols, xmk->modifiermap[xmk->max_keypermod * i + j], k);
+ 
+                 switch (keySymX) {
+                 case XK_Alt_L:
+@@ -628,6 +629,7 @@ bool initializeMods()
+     g_rgX11ModInfo[2].modX = g_alt_mask;
+     g_rgX11ModInfo[3].modX = g_meta_mask;
+ 
++    xcb_key_symbols_free(symbols);
+     XFreeModifiermap(xmk);
+     g_bInitializedMods = true;
+ 
+-- 
+GitLab
+

diff --git a/kde-frameworks/kwindowsystem/kwindowsystem-5.90.0-r1.ebuild b/kde-frameworks/kwindowsystem/kwindowsystem-5.90.0-r1.ebuild
new file mode 100644
index 000000000000..9b74f0ae66e9
--- /dev/null
+++ b/kde-frameworks/kwindowsystem/kwindowsystem-5.90.0-r1.ebuild
@@ -0,0 +1,46 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+QTMIN=5.15.2
+VIRTUALX_REQUIRED="test"
+inherit ecm kde.org
+
+DESCRIPTION="Framework providing access to properties and features of the window manager"
+LICENSE="|| ( LGPL-2.1 LGPL-3 ) MIT"
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~riscv ~x86"
+IUSE="nls X"
+
+RESTRICT="test"
+
+RDEPEND="
+	>=dev-qt/qtgui-${QTMIN}:5
+	X? (
+		>=dev-qt/qtx11extras-${QTMIN}:5
+		x11-libs/libX11
+		x11-libs/libXfixes
+		x11-libs/libxcb
+		x11-libs/xcb-util-keysyms
+	)
+"
+DEPEND="${RDEPEND}
+	X? ( x11-base/xorg-proto )
+	test? ( >=dev-qt/qtwidgets-${QTMIN}:5 )
+"
+BDEPEND="
+	nls? ( >=dev-qt/linguist-tools-${QTMIN}:5 )
+"
+
+DOCS=( docs/README.kstartupinfo )
+
+PATCHES=( "${FILESDIR}/${P}-avoid-XKeycodeToKeysym.patch" ) # KDE-bug 426684
+
+src_configure() {
+	local mycmakeargs=(
+		-DKWINDOWSYSTEM_NO_WIDGETS=ON
+		$(cmake_use_find_package X X11)
+	)
+
+	ecm_src_configure
+}