Initialize gamepad navigation when streaming from the terminal

This commit is contained in:
Cameron Gutman 2020-08-29 12:59:13 -07:00
parent 1bc3675548
commit 81019fa2a8
2 changed files with 9 additions and 0 deletions

View file

@ -2,6 +2,7 @@ import QtQuick 2.0
import QtQuick.Controls 2.2
import ComputerManager 1.0
import SdlGamepadKeyNavigation 1.0
Item {
function onSearchingComputer() {
@ -35,6 +36,11 @@ Item {
StackView.onActivated: {
if (!launcher.isExecuted()) {
toolBar.visible = false
// Normally this is enabled by PcView, but we will won't
// load PcView when streaming from the command-line.
SdlGamepadKeyNavigation.enable()
launcher.searchingComputer.connect(onSearchingComputer)
launcher.searchingApp.connect(onSearchingApp)
launcher.sessionCreated.connect(onSessionCreated)

View file

@ -26,6 +26,9 @@ CenteredGridView {
currentIndex = -1
}
// Note: Any initialization done here that is critical for streaming must
// also be done in CliStartStreamSegue.qml, since this code does not run
// for command-line initiated streams.
StackView.onActivated: {
// Setup signals on CM
ComputerManager.computerAddCompleted.connect(addComplete)