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

make sure we wait for the screen session #4316

Merged
merged 4 commits into from
Sep 4, 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 @@ -2,6 +2,7 @@

## [Unreleased]

- Make sure we wait for the screen session [#4316](https://github.com/MakieOrg/Makie.jl/pull/4316).
- Fix for absrect [#4312](https://github.com/MakieOrg/Makie.jl/pull/4312).
- Fix attribute updates for SpecApi and SpecPlots (e.g. ecdfplot) [#4265](https://github.com/MakieOrg/Makie.jl/pull/4265).
- Bring back `poly` convert arguments for matrix with points as row [#4266](https://github.com/MakieOrg/Makie.jl/pull/4258).
Expand Down
8 changes: 5 additions & 3 deletions WGLMakie/src/display.jl
Original file line number Diff line number Diff line change
Expand Up @@ -209,11 +209,12 @@ function get_screen_session(screen::Screen; timeout=100,
throw_error("Screen has no session. Not yet displayed?")
return nothing
end
if !(screen.session.status in (Bonito.RENDERED, Bonito.DISPLAYED, Bonito.OPEN))
session = screen.session
if !(session.status in (Bonito.RENDERED, Bonito.DISPLAYED, Bonito.OPEN))
throw_error("Screen Session uninitialized. Not yet displayed? Session status: $(screen.session.status)")
return nothing
end
success = Bonito.wait_for_ready(screen.session; timeout=timeout)
success = Bonito.wait_for_ready(session; timeout=timeout)
if success !== :success
throw_error("Timed out waiting for session to get ready")
return nothing
Expand All @@ -224,7 +225,7 @@ function get_screen_session(screen::Screen; timeout=100,
throw_error("Timed out waiting $(timeout)s for session to get initilize")
end
# At this point we should have a fully initialized plot + session
return screen.session
return session
end

function Makie.apply_screen_config!(screen::Screen, config::ScreenConfig, args...)
Expand Down Expand Up @@ -258,6 +259,7 @@ function Base.display(screen::Screen, scene::Scene; unused...)
return render_with_init(screen, session, scene)
end
display(app)
Bonito.wait_for(()-> !isnothing(screen.session))
Bonito.wait_for_ready(screen.session)
# wait for plot to be full initialized, so that operations don't get racy (e.g. record/RamStepper & friends)
get_screen_session(screen; error="Waiting for plot to be initialized in display")
Expand Down
Loading