From 7d9eab15f00e38a5b4c25d084a904e3a8439807b Mon Sep 17 00:00:00 2001 From: maniak1349 Date: Thu, 5 May 2016 08:56:21 +0300 Subject: win32: make taskbar progress indication optional Add --taskbar-progress command line option and property which controls taskbar progress indication rendering in Windows 7+. This option is on by default and can be toggled during playback. This option does not affect the creation process of ITaskbarList3. When the option is turned off the progress bar is just hidden with TBPF_NOPROGRESS. Closes #2535 --- player/misc.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'player/misc.c') diff --git a/player/misc.c b/player/misc.c index f14f5a43e3..941c493cf2 100644 --- a/player/misc.c +++ b/player/misc.c @@ -116,16 +116,24 @@ void update_vo_playback_state(struct MPContext *mpctx) if (mpctx->video_out) { struct voctrl_playback_state oldstate = mpctx->vo_playback_state; struct voctrl_playback_state newstate = { + .taskbar_progress = mpctx->opts->vo.taskbar_progress, .playing = mpctx->playing, .paused = mpctx->paused, .percent_pos = get_percent_pos(mpctx), }; - if (oldstate.playing != newstate.playing || + if (oldstate.taskbar_progress != newstate.taskbar_progress || + oldstate.playing != newstate.playing || oldstate.paused != newstate.paused || - oldstate.percent_pos != newstate.percent_pos) { - vo_control(mpctx->video_out, - VOCTRL_UPDATE_PLAYBACK_STATE, &newstate); + oldstate.percent_pos != newstate.percent_pos) + { + // Don't update progress bar if it was and still is hidden + if ((oldstate.playing && oldstate.taskbar_progress) || + (newstate.playing && newstate.taskbar_progress)) + { + vo_control(mpctx->video_out, + VOCTRL_UPDATE_PLAYBACK_STATE, &newstate); + } mpctx->vo_playback_state = newstate; } } else { -- cgit v1.2.3