Merge pull request #1258 from jheinen/master

gr: fix 'hidden window' problem after savefig
This commit is contained in:
Josef Heinen 2017-11-21 14:58:12 +01:00 committed by GitHub
commit 6a8f4caee3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1329,12 +1329,18 @@ for (mime, fmt) in _gr_mimeformats
@eval function _show(io::IO, ::MIME{Symbol($mime)}, plt::Plot{GRBackend})
GR.emergencyclosegks()
filepath = tempname() * "." * $fmt
env = get(ENV, "GKSwstype", "0")
ENV["GKSwstype"] = $fmt
ENV["GKS_FILEPATH"] = filepath
gr_display(plt)
GR.emergencyclosegks()
write(io, readstring(filepath))
rm(filepath)
if env != "0"
ENV["GKSwstype"] = env
else
pop!(ENV,"GKSwstype")
end
end
end