Merge pull request #1978 from jheinen/master

gr: use correct workstation type after savefig()
This commit is contained in:
Josef Heinen 2019-04-01 14:18:51 +02:00 committed by GitHub
commit 2ad033f8e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1428,16 +1428,7 @@ const _gr_mimeformats = Dict(
"image/svg+xml" => "svg", "image/svg+xml" => "svg",
) )
const _gr_wstype_default = @static if Sys.islinux() const _gr_wstype = Ref(get(ENV, "GKSwstype", ""))
"x11"
# "cairox11"
elseif Sys.isapple()
"quartz"
else
"use_default"
end
const _gr_wstype = Ref(get(ENV, "GKSwstype", _gr_wstype_default))
gr_set_output(wstype::String) = (_gr_wstype[] = wstype) gr_set_output(wstype::String) = (_gr_wstype[] = wstype)
for (mime, fmt) in _gr_mimeformats for (mime, fmt) in _gr_mimeformats
@ -1472,7 +1463,7 @@ function _display(plt::Plot{GRBackend})
rm(filepath) rm(filepath)
else else
ENV["GKS_DOUBLE_BUF"] = true ENV["GKS_DOUBLE_BUF"] = true
if _gr_wstype[] != "use_default" if _gr_wstype[] != ""
ENV["GKSwstype"] = _gr_wstype[] ENV["GKSwstype"] = _gr_wstype[]
end end
gr_display(plt) gr_display(plt)