Fix focus issues with fullscreen notification

This is conceptually similar to the release_focus
signal added in 6aa19eb90f and
6f21accfae, but without having to thread the
signal through to TabbedBrowser and back.

Weirdly, doing self.setFocusPolicy(Qt.FocusPolicy.NoFocus) in
FullscreenNotification.__init__ did not help, so let's just set the focus
manually instead.

Fixes #8174.
Fixes #8625.
This commit is contained in:
Florian Bruhin 2025-10-10 20:46:48 +02:00
parent 6f21accfae
commit ddfd17d749
2 changed files with 6 additions and 0 deletions

View File

@ -53,6 +53,8 @@ Fixed
from a `qute://` page to a web page, e.g. when searching on `qute://start`
- Hopefully proper fix for some web pages jumping to the top when the statusbar
is hidden. (#8223)
- Fix for the page header being shown on YouTube after the fullscreen notification was hidden (#8625).
- Fix for videos losing keyboard focus when the fullscreen notification shows (#8174).
[[v3.5.1]]
v3.5.1 (2025-06-05)

View File

@ -940,6 +940,10 @@ class _WebEnginePermissions(QObject):
notif = miscwidgets.FullscreenNotification(self._widget)
notif.set_timeout(timeout)
notif.show()
# Restore keyboard focus to the tab. Setting a NoFocus policy
# for FullscreenNotification doesn't seem to work.
if self._widget.isVisible():
self._widget.setFocus()
@pyqtSlot(QUrl, 'QWebEnginePage::Feature')
def _on_feature_permission_requested(self, url, feature):