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

Show window top bar when idle #251

Open
Keith94 opened this issue Nov 25, 2024 · 13 comments
Open

Show window top bar when idle #251

Keith94 opened this issue Nov 25, 2024 · 13 comments
Labels
feature request New feature or request help wanted Extra attention is needed

Comments

@Keith94
Copy link
Contributor

Keith94 commented Nov 25, 2024

Expected behavior of the wanted feature

Enable window_top_bar functionality when mpv is on idle screen (no file loaded).

@Keith94 Keith94 added the feature request New feature or request label Nov 25, 2024
@Samillion
Copy link
Owner

Oh wow, I didn't even realize this doesn't show, even on stock osc! I wonder why.

@Keith94
Copy link
Contributor Author

Keith94 commented Nov 28, 2024

Oh wow, I didn't even realize this doesn't show, even on stock osc! I wonder why.

Yeah it's strange indeed; there's a feature request for it here: mpv-player/mpv#13167

@Anthonyy232
Copy link
Contributor

This would actually be awesome.

@zenwav
Copy link

zenwav commented Dec 4, 2024

I second this.

@Samillion
Copy link
Owner

I'm still trying to figure out why mpv hasn't implemented this by default in osc.lua. I mentioned it a couple of times on irc, but I wasn't always present the last month.

@Keith94
Copy link
Contributor Author

Keith94 commented Dec 20, 2024

True. Would be simple to port it over once they add it officially.

@Samillion
Copy link
Owner

Indeed. One of the main things I wanted to keep with ModernZ is that it's based on osc.lua.

This specific feature would require a drastic change (osc render). Unless there is a simple way that my brain is unable to think of yet.

@Keith94
Copy link
Contributor Author

Keith94 commented Dec 20, 2024

There's another popular 3rd party OSC that implemented it, but I didn't look into how he did it.

@Samillion
Copy link
Owner

There's another popular 3rd party OSC that implemented it, but I didn't look into how he did it.

What's their repo link? I'd love to see their implementation.

@Keith94
Copy link
Contributor Author

Keith94 commented Dec 21, 2024

@Samillion
Copy link
Owner

Samillion commented Dec 21, 2024

Ohh. Yeah. To be very frank, uosc is an amazing implementation as an osc overall that broke the osc standard and went over and beyond. It is the closest thing to a GUI toolkit yet it's just an OSC.

To be clear, this feature is doable. A simple (broken) example, in the tick function:

ModernZ/modernz.lua

Lines 3112 to 3117 in 80ea6b7

tick = function()
if state.marginsREQ == true then
state.marginsREQ = false
end
if not state.enabled then return end

It controls osc render:

ModernZ/modernz.lua

Lines 3162 to 3170 in 80ea6b7

elseif (state.fullscreen and user_opts.showfullscreen)
or (not state.fullscreen and user_opts.showwindowed) then
-- render the OSC
render()
else
-- Flush OSD
render_wipe()
end

Changing this only shows it (broken) with osc in idle:

        end
+    end
-    elseif (state.fullscreen and user_opts.showfullscreen)
+    if (state.fullscreen and user_opts.showfullscreen)

Obviously it's broken here because it's essentially ticking render constantly, but it shows you why the osc would need many changes.

  • Adjust show/hide_osc behavior for idle state and include osc render/render_wipe
  • Adjust default values (such as title, play controls and such) to match an idle state
  • Adjust show/hide_osc to be separate for top bar and controls (bottom)

The end result though would be many changes that would break the "based on osc.lua" thing. I think this is me hesitating because of paranoia and false set of standards.

Also, I'm almost certain there is even a simpler way to do this that my brain is just not picking up lol.

@Keith94
Copy link
Contributor Author

Keith94 commented Dec 21, 2024

Damn. That could explain why it hasn't made it into mpv yet because of all the changes. Probably not a lot of discussion around it either.

Should we close and re open it later once it's added?

@Samillion
Copy link
Owner

I don't mind leaving it open, since the same mpv issue has been open for over a year now. Maybe this will allow it to be discovered more and someone shares an input or an idea that make the implementation of this feature not so complicated..

@Samillion Samillion added the help wanted Extra attention is needed label Dec 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants