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
+5 -7
View File
@@ -1,17 +1,15 @@
import QtQuick 2.0 import QtQuick 2.0
import QtQuick.Controls 2.2 import QtQuick.Controls 2.3
Dialog { Dialog {
// We should use Overlay.overlay here but that's not available in Qt 5.9 :( modal: true
parent: ApplicationWindow.contentItem
x: Math.round((parent.width - width) / 2) x: Math.round((parent.width - width) / 2)
y: Math.round((parent.height - height) / 2) y: Math.round((parent.height - height) / 2)
onAboutToHide: { onClosed: {
// We must force focus back to the last item for platforms without // We must force focus back to the last item. If we don't,
// support for more than one active window like Steam Link. If // gamepad and keyboard navigation will break after a
// we don't, gamepad and keyboard navigation will break after a
// dialog appears. // dialog appears.
stackView.forceActiveFocus() stackView.forceActiveFocus()
} }
-4
View File
@@ -289,10 +289,6 @@ CenteredGridView {
NavigableMessageDialog { NavigableMessageDialog {
id: pairDialog id: pairDialog
// Pairing dialog must be modal to prevent double-clicks from triggering
// pairing twice
modal: true
closePolicy: Popup.CloseOnEscape closePolicy: Popup.CloseOnEscape
// don't allow edits to the rest of the window while open // don't allow edits to the rest of the window while open