mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-02-16 10:40:59 +00:00
Fix error dialog focus issues after dismissal on Steam Link
This commit is contained in:
21
app/gui/NavigableMessageDialog.qml
Normal file
21
app/gui/NavigableMessageDialog.qml
Normal file
@@ -0,0 +1,21 @@
|
||||
import QtQuick 2.0
|
||||
import QtQuick.Dialogs 1.2
|
||||
|
||||
MessageDialog {
|
||||
property Item originalFocusItem
|
||||
|
||||
onVisibleChanged: {
|
||||
if (!isWindow) {
|
||||
if (visible) {
|
||||
originalFocusItem = window.activeFocusItem
|
||||
}
|
||||
else {
|
||||
// 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
|
||||
// dialog appears.
|
||||
originalFocusItem.forceActiveFocus()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user