From ea5c5033fbf08762f374073ee2fb30c85a6ea7ba Mon Sep 17 00:00:00 2001 From: Elias Steurer Date: Sat, 1 Jul 2023 11:07:20 +0200 Subject: [PATCH] Add short delay before pausing to wait for... potential window animation to finish --- ScreenPlayWallpaper/qml/MultimediaView.qml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/ScreenPlayWallpaper/qml/MultimediaView.qml b/ScreenPlayWallpaper/qml/MultimediaView.qml index 5003d3ee..0fae315e 100644 --- a/ScreenPlayWallpaper/qml/MultimediaView.qml +++ b/ScreenPlayWallpaper/qml/MultimediaView.qml @@ -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() }