Don't poll gamepad input when the GUI is not focused/visible

This commit is contained in:
Cameron Gutman
2024-09-26 19:24:29 -05:00
parent 9b3d4c1ad7
commit 2a63ad53d7
5 changed files with 43 additions and 21 deletions
+8 -4
View File
@@ -76,8 +76,10 @@ Item {
streamSegueErrorDialog.text += "\n\n" + qsTr("This PC's Internet connection is blocking Moonlight. Streaming over the Internet may not work while connected to this network.")
}
// Enable GUI gamepad usage now
SdlGamepadKeyNavigation.enable()
if (window.gamepadInputActive) {
// Re-enable GUI gamepad usage now
SdlGamepadKeyNavigation.enable()
}
if (quitAfter) {
if (streamSegueErrorDialog.text) {
@@ -119,8 +121,10 @@ Item {
// Show the toolbar again when popped off the stack
toolBar.visible = true
// Enable GUI gamepad usage now
SdlGamepadKeyNavigation.enable()
if (window.gamepadInputActive) {
// Re-enable GUI gamepad usage now
SdlGamepadKeyNavigation.enable()
}
}
StackView.onActivated: {