mirror of
https://github.com/moonlight-stream/moonlight-qt
synced 2025-01-09 09:48:43 +00:00
Fix race condition that could cause quit segue to never dismiss
Fixes #1060
This commit is contained in:
parent
bb444f306a
commit
7073dd26de
3 changed files with 6 additions and 7 deletions
|
@ -345,7 +345,7 @@ CenteredGridView {
|
||||||
|
|
||||||
function quitApp() {
|
function quitApp() {
|
||||||
var component = Qt.createComponent("QuitSegue.qml")
|
var component = Qt.createComponent("QuitSegue.qml")
|
||||||
var params = {"appName": appName}
|
var params = {"appName": appName, "quitRunningAppFn": appModel.quitRunningApp}
|
||||||
if (segueToStream) {
|
if (segueToStream) {
|
||||||
// Store the session and app name if we're going to stream after
|
// Store the session and app name if we're going to stream after
|
||||||
// successfully quitting the old app.
|
// successfully quitting the old app.
|
||||||
|
@ -358,9 +358,6 @@ CenteredGridView {
|
||||||
}
|
}
|
||||||
|
|
||||||
stackView.push(component.createObject(stackView, params))
|
stackView.push(component.createObject(stackView, params))
|
||||||
|
|
||||||
// Trigger the quit after pushing the quit segue on screen
|
|
||||||
appModel.quitRunningApp()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onAccepted: quitApp()
|
onAccepted: quitApp()
|
||||||
|
|
|
@ -84,10 +84,8 @@ Item {
|
||||||
|
|
||||||
function quitApp() {
|
function quitApp() {
|
||||||
var component = Qt.createComponent("QuitSegue.qml")
|
var component = Qt.createComponent("QuitSegue.qml")
|
||||||
var params = {"appName": appName}
|
var params = {"appName": appName, "quitRunningAppFn": launcher.quitRunningApp}
|
||||||
stackView.push(component.createObject(stackView, params))
|
stackView.push(component.createObject(stackView, params))
|
||||||
// Trigger the quit after pushing the quit segue on screen
|
|
||||||
launcher.quitRunningApp()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onAccepted: quitApp()
|
onAccepted: quitApp()
|
||||||
|
|
|
@ -6,6 +6,7 @@ import Session 1.0
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
property string appName
|
property string appName
|
||||||
|
property var quitRunningAppFn
|
||||||
property Session nextSession : null
|
property Session nextSession : null
|
||||||
property string nextAppName : ""
|
property string nextAppName : ""
|
||||||
|
|
||||||
|
@ -37,6 +38,9 @@ Item {
|
||||||
|
|
||||||
// Connect the quit completion signal
|
// Connect the quit completion signal
|
||||||
ComputerManager.quitAppCompleted.connect(quitAppCompleted)
|
ComputerManager.quitAppCompleted.connect(quitAppCompleted)
|
||||||
|
|
||||||
|
// Start the quit operation
|
||||||
|
quitRunningAppFn()
|
||||||
}
|
}
|
||||||
|
|
||||||
StackView.onDeactivating: {
|
StackView.onDeactivating: {
|
||||||
|
|
Loading…
Reference in a new issue