From 81019fa2a83d47782725eebc7843a30baefbc845 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sat, 29 Aug 2020 12:59:13 -0700 Subject: [PATCH] Initialize gamepad navigation when streaming from the terminal --- app/gui/CliStartStreamSegue.qml | 6 ++++++ app/gui/PcView.qml | 3 +++ 2 files changed, 9 insertions(+) diff --git a/app/gui/CliStartStreamSegue.qml b/app/gui/CliStartStreamSegue.qml index 2bca9797..9f0570b6 100644 --- a/app/gui/CliStartStreamSegue.qml +++ b/app/gui/CliStartStreamSegue.qml @@ -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) diff --git a/app/gui/PcView.qml b/app/gui/PcView.qml index 2c17ce83..af5fddf9 100644 --- a/app/gui/PcView.qml +++ b/app/gui/PcView.qml @@ -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)