Skip to content

Commit

Permalink
set GTK_PATH so GTK4 finds print and media backends on Linux and OSX (#…
Browse files Browse the repository at this point in the history
…61)

This sets an environmental variable to help GTK4 find print and media backends installed by GTK4_jll on Linux and OSX. Currently this only enables "print to file" but if CUPS is added to Yggdrasil this should enable that too.

Inspired by #60 but does not really fix it.

Amusingly, on Windows printing already seems to work without this.
  • Loading branch information
jwahlstrand authored May 12, 2024
1 parent 5ea0add commit 8b8ff7a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Gtk4.jl
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,15 @@ function __init__()
Base.get(ENV, "XDG_DATA_DIRS", nothing)::Union{String,Nothing},
]), Sys.iswindows() ? ";" : ":")

if !Sys.iswindows()
# Help GTK find modules for printing, media, and input backends
# May have consequences for GTK3 programs spawned by Julia
ENV["GTK_PATH"] = joinpath(dirname(GTK4_jll.libgtk4_path::String),"gtk-4.0")

# Following also works for finding the printing backends (and also may affect GTK3 programs)
#ENV["GTK_EXE_PREFIX"] = GTK4_jll.artifact_dir
end

gtype_wrapper_cache_init()
gboxed_cache_init()

Expand Down

0 comments on commit 8b8ff7a

Please sign in to comment.