mpv-scripts icon indicating copy to clipboard operation
mpv-scripts copied to clipboard

Add function of `shared_ script_ properties` to fix OSC logo conflict.

Open dyphire opened this issue 3 years ago • 7 comments

Please refer to https://github.com/mpv-player/mpv/issues/10201 , https://github.com/CogentRedTester/mpv-file-browser/issues/55.

It seems like a good idea that store the menu open status in the shared_script_properties property and using conditional auto-profiles.

This method can be adapted to other OSC scripts.

dyphire avatar May 19 '22 01:05 dyphire

I think the workaround in the README is good enough for now, especially since shared_script_properties are not recommended to be used.

I'll probably be updating once mpv developers make a solution that is friendlier for script devs.

If you need to auto-hide the logo when using other OSC scripts, then the below profile could be used. I did not add this to the documentation, maybe I should:

[disable-osc idle]
profile-cond=idle_active
osc=no
profile-restore=copy

The documentation states the following about shared_script_properties : https://mpv.io/manual/stable/#command-interface-shared-script-properties

This is very primitive, inefficient, and annoying to use. It's a makeshift solution which could go away any time (for example, when a better solution becomes available). This is also why this property has an annoying name. You should avoid using it, unless you absolutely have to.`

Eisa01 avatar May 19 '22 04:05 Eisa01

[disable-osc idle]
profile-cond=idle_active
osc=no
profile-restore=copy

This auto-profiles condition is not good enough. Because not all users want to lose the osc logo of mpv forever, it should be hidden only when the script menu is open.

dyphire avatar May 19 '22 04:05 dyphire

This profile does not cause the osc to be lost forever, it is only lost when mpv is idle, once a video is loaded then it will add the osc back

Eisa01 avatar May 19 '22 04:05 Eisa01

This profile does not cause the osc to be lost forever, it is only lost when mpv is idle, once a video is loaded then it will add the osc back

I mean that the logo will lost forever when mpv is idle. It not good.

dyphire avatar May 19 '22 04:05 dyphire

I see, what you are suggesting seems to be impossible without the use of shared_script_properties. I do not know why it is not recommended to be used, I will keep this open and consider adding it.

Eisa01 avatar May 19 '22 05:05 Eisa01

shared_script_properties may not be good enough, but I think these scripts should pass a variable to identify the menu open, such as menu-is-open.

dyphire avatar May 19 '22 05:05 dyphire

True, I'll make sure to keep this in mind for the next commit.

Eisa01 avatar May 19 '22 05:05 Eisa01