-
Notifications
You must be signed in to change notification settings - Fork 25
Description
The current session's user-defined visibility setting is lost if showonpause is active and an unpause event occurs.
Steps to Reproduce
- Set
keeponpause=yesinmodernz.conf - Set
visibility=alwaysinmodernz.conf - Add
Del script-binding modernz/visibilitytoinput.conf - Start
mpvwith a video - Pause the video
- Cycle the visibility to
auto - Unpause, then pause again
- Visibility will revert to the original setting (or whatever happened to be saved during the initial pause)
Root Cause
The user_opt.visibility field is used to store both the user's visibility preference (as set during a visibility cycle) and temporary overrides (e.g., during pause). ModernZ attempts to preserve the original preference by saving user_opt.visibility into state.temp_visibility_mode during pause. However, this approach is flawed:
- If the user cycles visibility while paused,
user_opt.visibilitywill be updated, butstate.temp_visibility_modewill not reflect this change. - On unpause,
state.temp_visibility_modeis restored, unintentionally overwriting the user's updated preference. - Additionally, if visibility is cycled while
showonpauseis active, it may affect the temporary state instead of the persistent user setting.
This dual use of user_opt.visibility leads to lost state and inconsistent behavior.
Proposed Fix
Persistent user preferences (even if runtime-only) should be stored separately from temporary script-driven changes.
See the following modification for a possible solution:
main...snaphat:ModernZ:main
Additional Notes
A similar issue occurs if mouse_seek_pause=yes is set in modernz.conf. After seeking with the mouse, the pause state is lost. I haven't analyzed the source code for that behavior.
Expected Behavior
.
Actual Behavior
.
Log File
No response
I carefully read all instructions and confirm that I did the following:
- I tested with the latest mpv version to validate that the issue is not already fixed.
- I provided all required information.