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

empty! the GLMakie screen for reuse instead of closeing and reopening #3881

Merged
merged 5 commits into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
- Added `transform_marker` attribute to meshscatter and changed the default behavior to not transform marker/mesh vertices [#4606](https://github.com/MakieOrg/Makie.jl/pull/4606)
- Fixed some issues with meshscatter not correctly transforming with transform functions and float32 rescaling [#4606](https://github.com/MakieOrg/Makie.jl/pull/4606)
- Fixed `poly` pipeline for 3D and/or Float64 polygons that begin from an empty vector [#4615](https://github.com/MakieOrg/Makie.jl/pull/4615).
- `empty!` GLMakie screen instead of closing, fixing issue with resetted window position [#3881](https://github.com/MakieOrg/Makie.jl/pull/3881)
- Added option to display the front spines in Axis3 to close the outline box [#2349](https://github.com/MakieOrg/Makie.jl/pull/4305)
- Fixed gaps in corners of `poly(Rect2(...))` stroke [#4664](https://github.com/MakieOrg/Makie.jl/pull/4664)
- Fixed an issue where `reinterpret`ed arrays of line points were not handled correctly in CairoMakie [#4668](https://github.com/MakieOrg/Makie.jl/pull/4668).
Expand Down
6 changes: 3 additions & 3 deletions GLMakie/src/screen.jl
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,8 @@ function singleton_screen(debugging::Bool)
if !isempty(SINGLETON_SCREEN)
@debug("reusing singleton screen")
screen = SINGLETON_SCREEN[1]
close(screen; reuse=false)
stop_renderloop!(screen; close_after_renderloop=false)
empty!(screen)
else
@debug("new singleton screen")
# reuse=false, because we "manually" re-use the singleton screen!
Expand Down Expand Up @@ -845,8 +846,6 @@ function stop_renderloop!(screen::Screen; close_after_renderloop=screen.close_af
c = screen.close_after_renderloop
screen.close_after_renderloop = close_after_renderloop
screen.stop_renderloop[] = true
screen.close_after_renderloop = c

# stop_renderloop! may be called inside renderloop as part of close
# in which case we should not wait for the task to finish (deadlock)
if Base.current_task() != screen.rendertask
Expand All @@ -855,6 +854,7 @@ function stop_renderloop!(screen::Screen; close_after_renderloop=screen.close_af
screen.rendertask = nothing
end
# else, we can't do that much in the rendertask itself
screen.close_after_renderloop = c
return
end

Expand Down
Loading