1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-09-15 06:52:34 +02:00

Add short delay before pausing to wait for...

potential window animation to finish
This commit is contained in:
Elias Steurer 2023-07-01 11:07:20 +02:00
parent ad10683a74
commit ea5c5033fb

View File

@ -55,7 +55,16 @@ Item {
volume: Wallpaper.volume
muted: Wallpaper.muted
}
// Wait until Windows window animation is complete
// before pausing the wallpaper
Timer {
id: pauseTimer
interval: 100
onTriggered: {
mediaPlayer.pause()
}
}
Connections {
function onFillModeChanged(fillMode) {
if (fillMode === "stretch") {
@ -76,10 +85,11 @@ Item {
}
function onVisualsPausedChanged(visualsPaused) {
print(visualsPaused)
if(!Wallpaper.isPlaying)
return
if(visualsPaused)
mediaPlayer.pause()
pauseTimer.start()
else
mediaPlayer.play()
}