Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

window-maximized observe property not reliable #7611

Open
stax76 opened this issue Apr 13, 2020 · 4 comments
Open

window-maximized observe property not reliable #7611

stax76 opened this issue Apr 13, 2020 · 4 comments
Labels
core:option-param-conf config, parameters, properties, options, shortcuts

Comments

@stax76
Copy link
Contributor

stax76 commented Apr 13, 2020

Important Information

Provide following Information:

  • mpv version: 0.32
  • Windows Version: w10 1909
  • Source of the mpv binary: shinchiro libmpv x64

Reproduction steps

In mpv.net I use an own window, occasionally people ask to implement mpv window properties, so I wanted to implement window-maximized, so I observe window-maximized. I get an initial change notification. When the property was set from CLI I set it via API. After that I expect to get overall 2 notifications but I get 3. It's easy for me to workaround, I don't know what's wrong but doesn't matter.

The issue is when I use cycle window-maximized in input.conf, then I don't get reliable results, it works maybe 8-9 times out 10, sometimes it's not sending the notification or other times 2 notifications together. My event handling code don't do anything special, the code that changes the form needs run asynchronously, it's likely that there is an issue in the client API. I remember a post from wm4 that related code is often rewritten which got me worried a lit bit but I really have nothing to complain, some things are complex by nature and everything is typically very stable and I always find a way to make things work, this is one of the rare occasions where I can't find a solution and it's not a real issue because users should rather not use window-maximized in input.conf but rather use the native Windows shortcuts win+up and win+down. I don't expect anything, it's all good, I just thought I post it anyway. I tried to reproduce it with mpv and lua but it only happens in mpv.net. I know a bit C and hope that in the future I can investigate such issues myself.

Log file: https://pastebin.com/MFn83epf

Thank you

@stax76
Copy link
Contributor Author

stax76 commented Apr 21, 2020

With border=no the osc shows a top bar with min, max and close buttons, I wanted to support this bar in my frontend and I also wanted generally full window-minimized and window-maximized support because there are scripts that rely on it like pause-when-minimize.lua. All this was working but again only 8 out of 10 times, so I spent some time debugging. In client.h the documentation says properties can be observed with MPV_FORMAT_NONE, so I tried that and now it's 100 % reliable. 👍

@stax76 stax76 closed this as completed Apr 21, 2020
@ghost
Copy link

ghost commented Apr 21, 2020

So you're saying observing with any other format doesn't work always?

@stax76
Copy link
Contributor Author

stax76 commented Apr 21, 2020

It works for other properties but not with window-maximized and window-minimized where MPV_FORMAT_FLAG is only 80% reliable while playback, without playback it's also 100% reliable.

@ghost
Copy link

ghost commented Apr 21, 2020

Sounds like a legitimate bug then.

@ghost ghost reopened this Apr 22, 2020
@Akemi Akemi added core:option-param-conf config, parameters, properties, options, shortcuts and removed os:win labels May 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core:option-param-conf config, parameters, properties, options, shortcuts
Projects
None yet
Development

No branches or pull requests

2 participants