Fix focusing after closing a dialog

This commit is contained in:
Cameron Gutman
2026-01-26 23:20:38 -06:00
parent 792f762c15
commit b4a5d21f97
2 changed files with 5 additions and 11 deletions

View File

@@ -1,17 +1,15 @@
import QtQuick 2.0
import QtQuick.Controls 2.2
import QtQuick.Controls 2.3
Dialog {
// We should use Overlay.overlay here but that's not available in Qt 5.9 :(
parent: ApplicationWindow.contentItem
modal: true
x: Math.round((parent.width - width) / 2)
y: Math.round((parent.height - height) / 2)
onAboutToHide: {
// We must force focus back to the last item for platforms without
// support for more than one active window like Steam Link. If
// we don't, gamepad and keyboard navigation will break after a
onClosed: {
// We must force focus back to the last item. If we don't,
// gamepad and keyboard navigation will break after a
// dialog appears.
stackView.forceActiveFocus()
}

View File

@@ -289,10 +289,6 @@ CenteredGridView {
NavigableMessageDialog {
id: pairDialog
// Pairing dialog must be modal to prevent double-clicks from triggering
// pairing twice
modal: true
closePolicy: Popup.CloseOnEscape
// don't allow edits to the rest of the window while open