Skip to content

Focus ManimGL window when previewing #39

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

Open
Splines opened this issue Oct 27, 2024 · 5 comments
Open

Focus ManimGL window when previewing #39

Splines opened this issue Oct 27, 2024 · 5 comments
Assignees
Labels
enhancement-archive Don't use this label anymore. waits for an external event waiting for certain external repos to make the necessary changes

Comments

@Splines
Copy link
Member

Splines commented Oct 27, 2024

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.

manim-not-focused.mp4

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.

@Splines Splines added the enhancement-archive Don't use this label anymore. label Oct 27, 2024
@Splines Splines changed the title Focus ManimGL window when previewing a command Focus ManimGL window when previewing Oct 27, 2024
@Splines
Copy link
Member Author

Splines commented Oct 27, 2024

This is also not something we need for the next release I guess. Just a nice to have.

@Splines
Copy link
Member Author

Splines commented Oct 30, 2024

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.

@Splines
Copy link
Member Author

Splines commented Nov 10, 2024

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).

@Splines Splines added the waits for an external event waiting for certain external repos to make the necessary changes label Nov 17, 2024
@Splines Splines self-assigned this Nov 17, 2024
@Splines
Copy link
Member Author

Splines commented Nov 25, 2024

3Blue1Brown just merged my PR 🎉 So, we can now use focus() in the IPython terminal.

@Splines Splines removed the waits for an external event waiting for certain external repos to make the necessary changes label Nov 25, 2024
@Splines
Copy link
Member Author

Splines commented Jan 13, 2025

Might want to wait till this window offset issue is resolved.

@Splines Splines added the waits for an external event waiting for certain external repos to make the necessary changes label Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement-archive Don't use this label anymore. waits for an external event waiting for certain external repos to make the necessary changes
Projects
None yet
Development

No branches or pull requests

1 participant