mirror of
https://github.com/moonlight-stream/moonlight-qt
synced 2024-12-13 04:42:27 +00:00
Delay Session::exec() for 250 ms to allow the StackView transition to complete
This commit is contained in:
parent
7bc43c226d
commit
b8ffb6e53d
1 changed files with 22 additions and 8 deletions
|
@ -57,6 +57,26 @@ Item {
|
||||||
toast.visible = true
|
toast.visible = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This timer delay allows the transition
|
||||||
|
// to this StreamSegue to complete before doing
|
||||||
|
// long operations in Session::exec(). It would
|
||||||
|
// be nice if we could find a way to avoid having
|
||||||
|
// to do this though.
|
||||||
|
Timer {
|
||||||
|
id: delayedStartTimer
|
||||||
|
interval: 250
|
||||||
|
onTriggered: {
|
||||||
|
// Run the streaming session to completion
|
||||||
|
session.exec(Screen.virtualX, Screen.virtualY)
|
||||||
|
|
||||||
|
// Show the Qt window again after streaming
|
||||||
|
window.visible = true
|
||||||
|
|
||||||
|
// Exit this view
|
||||||
|
stackView.pop()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
onVisibleChanged: {
|
onVisibleChanged: {
|
||||||
if (visible) {
|
if (visible) {
|
||||||
// Hide the toolbar before we start loading
|
// Hide the toolbar before we start loading
|
||||||
|
@ -69,14 +89,8 @@ Item {
|
||||||
session.displayLaunchError.connect(displayLaunchError)
|
session.displayLaunchError.connect(displayLaunchError)
|
||||||
session.displayLaunchWarning.connect(displayLaunchWarning)
|
session.displayLaunchWarning.connect(displayLaunchWarning)
|
||||||
|
|
||||||
// Run the streaming session to completion
|
// Kick off the delayed start
|
||||||
session.exec(Screen.virtualX, Screen.virtualY)
|
delayedStartTimer.running = true
|
||||||
|
|
||||||
// Show the Qt window again after streaming
|
|
||||||
window.visible = true
|
|
||||||
|
|
||||||
// Exit this view
|
|
||||||
stackView.pop()
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Show the toolbar again when we become hidden
|
// Show the toolbar again when we become hidden
|
||||||
|
|
Loading…
Reference in a new issue