From b646d606d7710244ab95b3c624212ff3c8f33b0a Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sat, 25 Oct 2025 16:43:06 +0200 Subject: [PATCH] Fix releasing focus when leaving command mode The fix for #8223 in 6f21accfaecaa7fbde585eaa88219844ae11ea24 was misguided: We don't really care about the statusbar being hidden, controlled release of keyboard focus needs to happen in any case where we're hiding the command widget (as that's when we lose keyboard focus). Fixes #8750. --- doc/changelog.asciidoc | 11 +++++++++++ qutebrowser/mainwindow/statusbar/bar.py | 5 +---- tests/end2end/features/completion.feature | 8 ++++++++ 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc index b7a3d807c..371678d7a 100644 --- a/doc/changelog.asciidoc +++ b/doc/changelog.asciidoc @@ -15,6 +15,17 @@ breaking changes (such as renamed commands) can happen in minor releases. // `Fixed` for any bug fixes. // `Security` to invite users to upgrade in case of vulnerabilities. +[[v3.6.1]] +v3.6.1 (unreleased) +------------------- + +Fixed +~~~~~ + +- A regression in v3.6.1 where the page didn't have keyboard focus after closing + the completion, so e.g. typing in an input field after hinting didn't work. + (#8750) + [[v3.6.0]] v3.6.0 (2025-10-24) ------------------- diff --git a/qutebrowser/mainwindow/statusbar/bar.py b/qutebrowser/mainwindow/statusbar/bar.py index 4b72ad59f..cce9e2c39 100644 --- a/qutebrowser/mainwindow/statusbar/bar.py +++ b/qutebrowser/mainwindow/statusbar/bar.py @@ -286,20 +286,16 @@ class StatusBar(QWidget): strategy = config.val.statusbar.show tab = self._current_tab() if tab is not None and tab.data.fullscreen: - self.release_focus.emit() self.hide() elif strategy == 'never': - self.release_focus.emit() self.hide() elif strategy == 'in-mode': try: mode_manager = modeman.instance(self._win_id) except modeman.UnavailableError: - self.release_focus.emit() self.hide() else: if mode_manager.mode == usertypes.KeyMode.normal: - self.release_focus.emit() self.hide() else: self.show() @@ -371,6 +367,7 @@ class StatusBar(QWidget): def _hide_cmd_widget(self): """Show temporary text instead of command widget.""" log.statusbar.debug("Hiding cmd widget") + self.release_focus.emit() self._stack.setCurrentWidget(self.txt) self.maybe_hide() diff --git a/tests/end2end/features/completion.feature b/tests/end2end/features/completion.feature index 782fe1988..4fd122715 100644 --- a/tests/end2end/features/completion.feature +++ b/tests/end2end/features/completion.feature @@ -103,3 +103,11 @@ Feature: Using completion And I run :completion-item-focus next And I run :cmd-set-text -s :set Then the completion model should be option + + Scenario: Page focus after using completion (#8750) + When I open data/insert_mode_settings/html/input.html + And I run :cmd-set-text : + And I run :mode-leave + And I run :click-element id qute-input + And I run :fake-key -g someinput + Then the javascript message "contents: someinput" should be logged