Avoid polling server status while streaming
This commit is contained in:
parent
974e44ba4c
commit
839c0a45a0
1 changed files with 23 additions and 0 deletions
|
|
@ -89,6 +89,29 @@ ApplicationWindow {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onVisibleChanged: {
|
||||||
|
// When we become invisible while streaming is going on,
|
||||||
|
// stop polling immediately.
|
||||||
|
if (!visible) {
|
||||||
|
inactivityTimer.stop()
|
||||||
|
|
||||||
|
if (pollingActive) {
|
||||||
|
ComputerManager.stopPollingAsync()
|
||||||
|
pollingActive = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (active) {
|
||||||
|
// When we become visible and active again, start polling
|
||||||
|
inactivityTimer.stop()
|
||||||
|
|
||||||
|
// Restart polling if it was stopped
|
||||||
|
if (!pollingActive) {
|
||||||
|
ComputerManager.startPolling()
|
||||||
|
pollingActive = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
onActiveChanged: {
|
onActiveChanged: {
|
||||||
if (active) {
|
if (active) {
|
||||||
// Stop the inactivity timer
|
// Stop the inactivity timer
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue