Skip to content

Reset UI when playback is stopped from mpv - #441

Open
fridrich wants to merge 1 commit into
linuxmint:masterfrom
fridrich:fix-osd-stop
Open

fridrich wants to merge 1 commit into
linuxmint:masterfrom
fridrich:fix-osd-stop

Conversation

@fridrich

@fridrich fridrich commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

When playback is stopped from mpv itself (the on-screen controller's stop, a keyboard shortcut, or the stream ending), Hypnotix doesn't notice. The player area stays black, the channel name and URL remain, and active_channel is still set.

Hypnotix only observes core-idle, which it uses for the screensaver inhibit. core-idle is also true while paused, so it can't tell a stop from a pause.

This change:

  • observes mpv's idle-active property, which is only true when no file is loaded, and calls on_stop_button() when it becomes true
  • sets an is_changing_channel flag around play_async(), because mpv is briefly idle between stop() and loading the next channel, and that must not count as a stop
  • re-reads idle_active in the handler, because the handler runs later on the GTK main loop and a new channel may have started by then
  • makes on_stop_button() clear the channel name/URL and show the empty page, instead of leaving the black player area

Tested: stopping from the OSD while playing and while paused returns to the empty page.

@fridrich

Copy link
Copy Markdown
Contributor Author

@mtwebster this could be interesting?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant