Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Wait for renderloop task to stop before restoring close_after_renderl…
…oop value Without this, one can observe that the singleton window is fully closed and reopened by applying the following patch: ```diff diff --git a/GLMakie/src/screen.jl b/GLMakie/src/screen.jl index ff8b69fdc..e18b8ba6b 100644 --- a/GLMakie/src/screen.jl +++ b/GLMakie/src/screen.jl @@ -839,6 +839,7 @@ function pause_renderloop!(screen::Screen) end function stop_renderloop!(screen::Screen; close_after_renderloop=screen.close_after_renderloop) + yield() # don't double close when stopping renderloop c = screen.close_after_renderloop screen.close_after_renderloop = close_after_renderloop @@ -974,7 +975,7 @@ function renderloop(screen) end if screen.close_after_renderloop try - @debug("Closing screen after quiting renderloop!") + @info("Closing screen after quiting renderloop!") close(screen) catch e @warn "error closing screen" exception=(e, Base.catch_backtrace()) ``` which aims to force the renderloop's task to run via the call to `yield()` so that the task is sleeping during the rest of the function call. (The logging change just makes the particular action easier to find than enabling debug-level logging.) Opening a plot and replotting at the REPL, I observe both the window quickly close and reappear and the log message being printed by the end of the renderloop: ```julia-repl julia> using GLMakie Precompiling GLMakie Info Given GLMakie was explicitly requested, output will be shown live [ Info: Closing screen after quiting renderloop! [ Info: Closing screen after quiting renderloop! [ Info: Closing screen after quiting renderloop! [ Info: Closing screen after quiting renderloop! [ Info: Closing screen after quiting renderloop! [ Info: Closing screen after quiting renderloop! [ Info: Closing screen after quiting renderloop! [ Info: Closing screen after quiting renderloop! [ Info: Closing screen after quiting renderloop! [ Info: Closing screen after quiting renderloop! [ Info: Closing screen after quiting renderloop! [ Info: Closing screen after quiting renderloop! [ Info: Closing screen after quiting renderloop! [ Info: Closing screen after quiting renderloop! [ Info: Closing screen after quiting renderloop! [ Info: Closing screen after quiting renderloop! [ Info: Closing screen after quiting renderloop! [ Info: Closing screen after quiting renderloop! [ Info: Closing screen after quiting renderloop! [ Info: Closing screen after quiting renderloop! [ Info: Closing screen after quiting renderloop! [ Info: Closing screen after quiting renderloop! [ Info: Closing screen after quiting renderloop! [ Info: Closing screen after quiting renderloop! [ Info: Closing screen after quiting renderloop! 1 dependency successfully precompiled in 21 seconds. 303 already precompiled. 1 dependency had output during precompilation: ┌ GLMakie │ [Output was shown above] └ julia> scatter([1, 6]) julia> scatter([1, 6]) [ Info: Closing screen after quiting renderloop! ``` With the changes in this commit, all of the log message disappear, including from the precompile process.
- Loading branch information