Skip to content
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]

- Fixed GLMakie embedding support for window destruction [#4848](https://github.com/MakieOrg/Makie.jl/pull/4848).
- Adjusted `DataInspector` tooltips for `spy` to be heatmap-like and `datashader` to show the number of binned markers [#4810](https://github.com/MakieOrg/Makie.jl/pull/4810)
- Add `unsafe_set!(::Textbox, ::String)` [#4417](https://github.com/MakieOrg/Makie.jl/pull/4417)
- Improved compatibility of marker attributes with float32convert, fixing issues with scatter markers being render too small with `markerspace = :data` in an Axis [#4869](https://github.com/MakieOrg/Makie.jl/pull/4869)
Expand Down
15 changes: 10 additions & 5 deletions GLMakie/src/screen.jl
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ Makie.@noconstprop function empty_screen(debugging::Bool, reuse::Bool, window)
owns_glscreen = isnothing(window)
initial_resolution = (10, 10)

if isnothing(window)
if owns_glscreen
windowhints = [
(GLFW.SAMPLES, 0),
(GLFW.DEPTH_BITS, 0),
Expand Down Expand Up @@ -710,8 +710,10 @@ function destroy!(screen::Screen)
window = screen.glscreen
if GLAbstraction.context_alive(window)
close(screen; reuse=false)
GLFW.SetWindowRefreshCallback(window, nothing)
GLFW.SetWindowContentScaleCallback(window, nothing)
if screen.owns_glscreen
GLFW.SetWindowRefreshCallback(window, nothing)
GLFW.SetWindowContentScaleCallback(window, nothing)
end
else
stop_renderloop!(screen; close_after_renderloop=false)
empty!(screen)
Expand Down Expand Up @@ -764,8 +766,11 @@ function Base.close(screen::Screen; reuse=true)
push!(SCREEN_REUSE_POOL, screen)
end

GLFW.SetWindowShouldClose(screen.glscreen, true)
GLFW.PollEvents()
if screen.owns_glscreen
GLFW.SetWindowShouldClose(screen.glscreen, true)
GLFW.PollEvents()
end

# Somehow, on osx, we need to hide the screen a second time!
set_screen_visibility!(screen, false)
return
Expand Down
2 changes: 2 additions & 0 deletions docs/src/explanations/backends/glmakie.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ do:
- `ShaderAbstractions.native_context_alive(::MyWindow)` (check if the window
OpenGL context is still valid)
- `GLMakie.framebuffer_size(::MyWindow)` (get the size of the windows framebuffer)
- `GLMakie.destroy!(::MyWindow)` ('destroy' the window, this should be a no-op
unless you want GLMakie to really close the window)
- `GLMakie.connect_screen(::Scene, Screen{MyWindow})` (connect input signals
for e.g. the keyboard and mouse; you may want to implement the individual
connection methods instead).
Expand Down
Loading