Open Splines opened 1 month ago
This is also not something we need for the next release I guess. Just a nice to have.
In #61 @VladimirFokow wrote:
is it possible to somehow make the video always stay on top?
Such a floating mode would indeed be really cool! (should be user-triggerable though for those who don't want this behavior)
to focus a window: MacOS has osascript (which Grant used to focus back on VSCode, but probably can be adapted to the manim window.. just have to figure out the name of the application)
It'd be cool to find an OS-independent solution. Since this is dealing with window management I think it's something that manim has to do for us, we can't "help it" do it. We have to go into deeper layers to achieve this behavior. But I mean: most graphical frameworks offer a way to create "windows" and most of the time they also have options to make it floating or to focus it etc. And these frameworks already abstract away OS-specific things, like specific APIs etc. So maybe there's a way to achieve this in some deeper layer inside Manim.
TL;DR: We have to ask people at Manim.
I filed a PR for this here. I haven't found a way to make the window floating, but at least to focus it (but still a bit hacky, see explanation over there).
3Blue1Brown just merged my PR 🎉 So, we can now use focus()
in the IPython terminal.
It'd be cool to focus the window that ManimGL has opened during startup whenever we preview some code. See the end of the following video to see what I mean. This preview is based on the code in #33.
https://github.com/user-attachments/assets/ab8f1fca-e8b5-44f9-82ed-fa4af109c398
I'm not sure if this is actually possible to achieve and I can't think of any way right now to programatically get a handle on this window. But who knows, maybe ManimGL is offering something like
focusWindow()
, then we could of course use that. And if this doesn't exist yet, we can always request it or implement it and file a PR on Grant's Manim repo.