From e37f73475a87e8bea295a67deb1a7495e277bf07 Mon Sep 17 00:00:00 2001 From: Joris Date: Fri, 24 May 2024 12:11:47 +0200 Subject: [PATCH] Fix focus after reload MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since the migration to Qt6, reloading the browser, either using CTRL+R, or CTRL+SHIFT+R, the focus is lost on the webview. By clearing the focus, it’s properly set afterward, after a reload. I also tried to play with focus policy, and setting focus after a bit with a timer, but without success. --- kiosk/kiosk_browser/browser_widget.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kiosk/kiosk_browser/browser_widget.py b/kiosk/kiosk_browser/browser_widget.py index cd8b44d5..6586c1ea 100644 --- a/kiosk/kiosk_browser/browser_widget.py +++ b/kiosk/kiosk_browser/browser_widget.py @@ -137,6 +137,8 @@ def _view(self, status): self._loading_page.hide() self._network_error_page.hide() self._webview.show() + # Set focus by clearing first, otherwise focus is lost after using CTRL+R + self._webview.clearFocus() self._webview.setFocus() def user_agent_with_system(user_agent, system_name, system_version):