1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-09-18 16:32:33 +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 volume: Wallpaper.volume
muted: Wallpaper.muted muted: Wallpaper.muted
} }
// Wait until Windows window animation is complete
// before pausing the wallpaper
Timer {
id: pauseTimer
interval: 100
onTriggered: {
mediaPlayer.pause()
}
}
Connections { Connections {
function onFillModeChanged(fillMode) { function onFillModeChanged(fillMode) {
if (fillMode === "stretch") { if (fillMode === "stretch") {
@ -76,10 +85,11 @@ Item {
} }
function onVisualsPausedChanged(visualsPaused) { function onVisualsPausedChanged(visualsPaused) {
print(visualsPaused)
if(!Wallpaper.isPlaying) if(!Wallpaper.isPlaying)
return return
if(visualsPaused) if(visualsPaused)
mediaPlayer.pause() pauseTimer.start()
else else
mediaPlayer.play() mediaPlayer.play()
} }