commit:     f076ce9eb0417826ba0ac78d5c2eac8eca281255
Author:     Maciej Barć <xgqt <AT> gentoo <DOT> org>
AuthorDate: Sat Jan 31 10:51:52 2026 +0000
Commit:     Maciej Barć <xgqt <AT> gentoo <DOT> org>
CommitDate: Sat Jan 31 14:03:47 2026 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f076ce9e

app-admin/keepassxc: apply the AutoType patch

Closes: https://bugs.gentoo.org/968759
Signed-off-by: Maciej Barć <xgqt <AT> gentoo.org>

 .../files/keepassxc-2.7.11-AutoType.patch          |  69 ++++++++++++
 app-admin/keepassxc/keepassxc-2.7.11-r1.ebuild     | 121 +++++++++++++++++++++
 2 files changed, 190 insertions(+)

diff --git a/app-admin/keepassxc/files/keepassxc-2.7.11-AutoType.patch 
b/app-admin/keepassxc/files/keepassxc-2.7.11-AutoType.patch
new file mode 100644
index 000000000000..cc0124bd851b
--- /dev/null
+++ b/app-admin/keepassxc/files/keepassxc-2.7.11-AutoType.patch
@@ -0,0 +1,69 @@
+From 85f7276ac2aade72fb0ebeb36ee53b32b6d6fa87 Mon Sep 17 00:00:00 2001
+From: Jonathan White <[email protected]>
+Date: Tue, 25 Nov 2025 18:35:31 -0500
+Subject: [PATCH] Revert Auto-Type change that caused race condition
+
+* Fixes #12723
+---
+ src/autotype/AutoType.cpp | 17 +++++++++++------
+ 1 file changed, 11 insertions(+), 6 deletions(-)
+
+diff --git a/src/autotype/AutoType.cpp b/src/autotype/AutoType.cpp
+index 44815fa6f8..83e18658dd 100644
+--- a/src/autotype/AutoType.cpp
++++ b/src/autotype/AutoType.cpp
+@@ -115,6 +115,8 @@ namespace
+                                                         {"f14", Qt::Key_F14},
+                                                         {"f15", Qt::Key_F15},
+                                                         {"f16", Qt::Key_F16}};
++    constexpr int s_minWaitDelay = 100; // 100 ms
++    constexpr int s_maxWaitDelay = 10000; // 10 seconds
+ } // namespace
+ 
+ AutoType* AutoType::m_instance = nullptr;
+@@ -312,6 +314,9 @@ void AutoType::executeAutoTypeActions(const Entry* entry,
+     // Restore executor mode
+     m_executor->mode = mode;
+ 
++    // Initial Auto-Type delay to allow window to come to foreground
++    Tools::wait(qBound(s_minWaitDelay, 
config()->get(Config::AutoTypeStartDelay).toInt(), s_maxWaitDelay));
++
+     // Grab the current active window after everything settles
+     if (window == 0) {
+         window = m_plugin->activeWindow();
+@@ -543,16 +548,16 @@ AutoType::parseSequence(const QString& entrySequence, 
const Entry* entry, QStrin
+     }
+ 
+     const int maxTypeDelay = 500;
+-    const int maxWaitDelay = 10000;
+     const int maxRepetition = 100;
++    
+     int currentTypingDelay = qBound(0, 
config()->get(Config::AutoTypeDelay).toInt(), maxTypeDelay);
+-    int cumulativeDelay = qBound(0, 
config()->get(Config::AutoTypeStartDelay).toInt(), maxWaitDelay);
++    // Take into account the initial delay which is added before any actions 
are performed
++    int cumulativeDelay = qBound(s_minWaitDelay, 
config()->get(Config::AutoTypeStartDelay).toInt(), s_maxWaitDelay);
+ 
+     // Initial actions include start delay and initial inter-key delay
+     QList<QSharedPointer<AutoTypeAction>> actions;
+     actions << QSharedPointer<AutoTypeBegin>::create();
+     actions << QSharedPointer<AutoTypeDelay>::create(currentTypingDelay, 
true);
+-    actions << QSharedPointer<AutoTypeDelay>::create(cumulativeDelay);
+ 
+     // Replace escaped braces with a template for easier regex
+     QString sequence = entrySequence;
+@@ -631,12 +636,12 @@ AutoType::parseSequence(const QString& entrySequence, 
const Entry* entry, QStrin
+             actions << QSharedPointer<AutoTypeDelay>::create(qBound(0, delay, 
maxTypeDelay), true);
+         } else if (placeholder == "delay") {
+             // Mid typing delay (wait), repeat represents the desired delay 
in milliseconds
+-            if (repeat > maxWaitDelay) {
+-                error = tr("Very long delay detected, max is %1: 
%2").arg(maxWaitDelay).arg(fullPlaceholder);
++            if (repeat > s_maxWaitDelay) {
++                error = tr("Very long delay detected, max is %1: 
%2").arg(s_maxWaitDelay).arg(fullPlaceholder);
+                 return {};
+             }
+             cumulativeDelay += repeat;
+-            actions << QSharedPointer<AutoTypeDelay>::create(qBound(0, 
repeat, maxWaitDelay));
++            actions << QSharedPointer<AutoTypeDelay>::create(qBound(0, 
repeat, s_maxWaitDelay));
+         } else if (placeholder == "clearfield") {
+             // Platform-specific field clearing
+             actions << QSharedPointer<AutoTypeClearField>::create();

diff --git a/app-admin/keepassxc/keepassxc-2.7.11-r1.ebuild 
b/app-admin/keepassxc/keepassxc-2.7.11-r1.ebuild
new file mode 100644
index 000000000000..eb21aeffbbc2
--- /dev/null
+++ b/app-admin/keepassxc/keepassxc-2.7.11-r1.ebuild
@@ -0,0 +1,121 @@
+# Copyright 1999-2026 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake xdg
+
+DESCRIPTION="KeePassXC - KeePass Cross-platform Community Edition"
+HOMEPAGE="https://keepassxc.org";
+
+if [[ "${PV}" = *9999* ]] ; then
+       inherit git-r3
+
+       EGIT_BRANCH="develop"
+       EGIT_REPO_URI="https://github.com/keepassxreboot/${PN}";
+else
+       if [[ "${PV}" == *_beta* ]] ; then
+               
SRC_URI="https://github.com/keepassxreboot/${PN}/archive/${PV/_/-}.tar.gz
+                       -> ${P}.gh.tar.gz"
+               S="${WORKDIR}/${P/_/-}"
+       else
+               
SRC_URI="https://github.com/keepassxreboot/${PN}/archive/${PV}.tar.gz
+                       -> ${P}.gh.tar.gz"
+       fi
+
+       KEYWORDS="~amd64 ~arm64 ~ppc64 ~riscv ~x86"
+fi
+
+# COPYING order
+LICENSE="|| ( GPL-2 GPL-3 ) BSD LGPL-2.1 MIT LGPL-2 CC0-1.0 Apache-2.0 GPL-2+ 
BSD-2"
+SLOT="0"
+IUSE="X autotype browser doc keeshare +keyring +network +ssh-agent test 
yubikey"
+
+RESTRICT="!test? ( test )"
+REQUIRED_USE="autotype? ( X )"
+
+RDEPEND="
+       app-crypt/argon2:=
+       dev-libs/botan:3=
+       dev-libs/zxcvbn-c
+       dev-qt/qtconcurrent:5
+       dev-qt/qtcore:5
+       dev-qt/qtdbus:5
+       dev-qt/qtgui:5
+       dev-qt/qtnetwork:5
+       dev-qt/qtsvg:5
+       dev-qt/qtwidgets:5
+       media-gfx/qrencode:=
+       sys-libs/readline:0=
+       virtual/minizip:=
+       X? (
+               dev-qt/qtx11extras:5
+       )
+       autotype? (
+               x11-libs/libX11
+               x11-libs/libXtst
+       )
+       yubikey? (
+               dev-libs/libusb:1
+               sys-apps/pcsc-lite
+       )
+"
+DEPEND="
+       ${RDEPEND}
+       dev-qt/qttest:5
+"
+BDEPEND="
+       dev-qt/linguist-tools:5
+       doc? (
+               dev-ruby/asciidoctor
+       )
+"
+
+PATCHES=(
+       "${FILESDIR}/${PN}-2.7.10-cmake_minimum.patch"
+       "${FILESDIR}/${PN}-2.7.10-tests.patch"
+       "${FILESDIR}/${PN}-2.7.10-zxcvbn.patch"
+       "${FILESDIR}/${PN}-2.7.11-AutoType.patch"
+)
+
+src_prepare() {
+       if ! [[ "${PV}" =~ _beta|9999 ]]; then
+               echo "${PV}" > .version || die
+       fi
+
+       # Unbundle zxcvbn, bug 958062
+       rm -r ./src/thirdparty/zxcvbn || die
+
+       cmake_src_prepare
+}
+
+src_configure() {
+       local -a mycmakeargs=(
+               # Gentoo users enable ccache via e.g. FEATURES=ccache or
+               # other means. We don't want the build system to enable it for 
us.
+               -DWITH_CCACHE="OFF"
+               -DWITH_GUI_TESTS="OFF"
+               -DWITH_XC_BOTAN3="ON"
+               -DWITH_XC_UPDATECHECK="OFF"
+
+               -DWITH_TESTS="$(usex test)"
+               -DWITH_XC_AUTOTYPE="$(usex autotype)"
+               -DWITH_XC_BROWSER="$(usex browser)"
+               -DWITH_XC_BROWSER_PASSKEYS="$(usex browser)"
+               -DWITH_XC_DOCS="$(usex doc)"
+               -DWITH_XC_FDOSECRETS="$(usex keyring)"
+               -DWITH_XC_KEESHARE="$(usex keeshare)"
+               -DWITH_XC_NETWORKING="$(usex network)"
+               -DWITH_XC_SSHAGENT="$(usex ssh-agent)"
+               -DWITH_XC_X11="$(usex X)"
+               -DWITH_XC_YUBIKEY="$(usex yubikey)"
+       )
+
+       if [[ "${PV}" == *_beta* ]] ; then
+               mycmakeargs+=(
+                       -DOVERRIDE_VERSION="${PV/_/-}"
+               )
+       fi
+
+       cmake_src_configure
+}

Reply via email to