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

Remember window position for popup windows in GLMakie #3294

Closed
pdeffebach opened this issue Oct 13, 2023 · 3 comments
Closed

Remember window position for popup windows in GLMakie #3294

pdeffebach opened this issue Oct 13, 2023 · 3 comments
Labels
enhancement Feature requests and enhancements

Comments

@pdeffebach
Copy link

Feature description

Currently, when GLMakie draws a plot on my screen (i.e. when I do lines(rand(10), rand(10)), it opens up a new window every time. It opens up a new window in the center of my screen. This is very annoying, as it covers up my terminal and I have to move it every time.

Plots.jl, by contrast, will re-populate an existing window. This means that it pops up, I move the plot window so that it does not cover my terminal, and then every time I call plot it re-plots in the same window. I like this behavior because it is annoying to have to move the window every time in GLMakie.

Any chance you could make drawing a new plot in the current window default behavior?

@pdeffebach pdeffebach added the enhancement Feature requests and enhancements label Oct 13, 2023
@kbarros
Copy link
Contributor

kbarros commented Apr 3, 2024

I had a chat with @SimonDanisch, and I think GLMakie does currently reuse the existing figure (to the extent possible in GLFW).

However, creating a new plot will always resize the window. It would be nice to reuse the current window dimensions by default (maybe accepting a size hint, to be used if no window exists yet?)

@SimonDanisch
Copy link
Member

Just to clarify, the OS window is being re-used in GLMakie.
We only close + reopen the singleton screen:
https://github.com/MakieOrg/Makie.jl/blob/master/GLMakie/src/screen.jl#L321-L333

close:

https://github.com/MakieOrg/Makie.jl/blob/master/GLMakie/src/screen.jl#L623-L640

reopen!:

https://github.com/MakieOrg/Makie.jl/blob/master/GLMakie/src/screen.jl#L294-L306

On windows, the position is remembered. Why this isn't the case for OSX isn't really clear. As you can see in the linked functions, we only hide + unhide the window and then resize it to the figure size.
If someone has access to OSX you may want to play around with these functions and try to see if anything can make OSX remember the position.

Remembering the size of the plot is something else, since it would have a more complex interaction with the theme, but would certainly possible as well.

@kbarros
Copy link
Contributor

kbarros commented Apr 4, 2024

Hi @SimonDanisch, sorry for the confusion. Indeed, the position is being remembered on OSX. As far as I can tell, this feature is fully working. I created a separate issue for the persistent window size feature request: #3767.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature requests and enhancements
Projects
None yet
Development

No branches or pull requests

3 participants