From b95abb2e0664b9c7116891aa954abba18931fbed Mon Sep 17 00:00:00 2001 From: SimonDanisch Date: Mon, 29 Jan 2024 12:57:05 +0100 Subject: [PATCH] fix redisplaying figures on same screen --- GLMakie/src/display.jl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/GLMakie/src/display.jl b/GLMakie/src/display.jl index 5135fa1f1b5..c8cb5a85064 100644 --- a/GLMakie/src/display.jl +++ b/GLMakie/src/display.jl @@ -2,6 +2,10 @@ function Base.display(screen::Screen, scene::Scene; connect=true) # So, the GLFW window events are not guarantee to fire # when we close a window, so we ensure this here! if !Makie.is_displayed(screen, scene) + if !isnothing(screen.root_scene) + delete!(screen, screen.root_scene) + screen.root_scene = nothing + end display_scene!(screen, scene) else @assert screen.root_scene === scene "internal error. Scene already displayed by screen but not as root scene"