@@ -109,7 +109,6 @@ copy_env_variable GDK_BACKEND
109109copy_env_variable GTK_PATH
110110copy_env_variable GTK_EXE_PREFIX
111111copy_env_variable GTK_IM_MODULE_FILE
112- copy_env_variable LIBGL_DRIVERS_PATH
113112
114113# XDG Config
115114prepend_dir XDG_CONFIG_DIRS " $SNAP /etc/xdg"
@@ -121,16 +120,12 @@ prepend_dir XDG_DATA_DIRS "$SNAP/data-dir"
121120prepend_dir XDG_DATA_DIRS " $SNAP_USER_DATA "
122121
123122# Set XDG_DATA_HOME to local path
124- ensure_dir_exists " $SNAP_USER_DATA /.local/share"
123+ export XDG_DATA_HOME=" $SNAP_USER_DATA /.local/share"
124+ ensure_dir_exists " $XDG_DATA_HOME "
125125
126126# Workaround for GLib < 2.53.2 not searching for schemas in $XDG_DATA_HOME:
127127# https://bugzilla.gnome.org/show_bug.cgi?id=741335
128- prepend_dir XDG_DATA_DIRS " $SNAP_USER_DATA /.local/share"
129-
130- # Use the snap MESA drivers to launch the snap.
131- # This is required by wayland, but electron will make better use under X11 too
132- prepend_dir LIBGL_DRIVERS_PATH " $SNAP /usr/lib/dri"
133- prepend_dir LIBGL_DRIVERS_PATH " $SNAP /usr/lib/$ARCH /dri"
128+ prepend_dir XDG_DATA_DIRS " $XDG_DATA_HOME "
134129
135130# Set cache folder to local path
136131if [[ -d " $SNAP_USER_DATA /.cache" && ! -e " $SNAP_USER_COMMON /.cache" ]]; then
@@ -158,30 +153,47 @@ if [[ -n "$XDG_RUNTIME_DIR" && -z "$DISABLE_WAYLAND" ]] && \
158153 if [ -n " $WAYLAND_DISPLAY " ]; then
159154 wdisplay=" $WAYLAND_DISPLAY "
160155 fi
156+ wayland_sockpath=" $XDG_RUNTIME_DIR /../$wdisplay "
161157 wayland_snappath=" $XDG_RUNTIME_DIR /$wdisplay "
162- if [ -S " $wayland_snappath " ]; then
158+ if [ -S " $wayland_sockpath " ]; then
163159 # if running under wayland, use it
164160 # export WAYLAND_DEBUG=1
165161 # shellcheck disable=SC2034
166162 wayland_available=true
163+ # create the compat symlink for now
164+ if [ ! -e " $wayland_snappath " ]; then
165+ ln -s " $wayland_sockpath " " $wayland_snappath "
166+ fi
167167 fi
168168fi
169169
170170# Keep an array of data dirs, for looping through them
171171IFS=' :' read -r -a data_dirs_array <<< " $XDG_DATA_DIRS"
172172
173- # Build mime.cache
174- # needed for gtk and qt icon
173+ # Font Config
174+ export FONTCONFIG_PATH=" /etc/fonts"
175+ export FONTCONFIG_FILE=" /etc/fonts/fonts.conf"
176+
175177if [ " $needs_update " = true ]; then
176- rm -rf " $SNAP_USER_DATA /.local/share/mime"
177- if [ ! -f " $SNAP /usr/share/mime/mime.cache" ]; then
178- if command -v update-mime-database > /dev/null; then
179- cp --preserve=timestamps -dR " $SNAP /usr/share/mime" " $SNAP_USER_DATA /.local/share"
180- async_exec update-mime-database " $SNAP_USER_DATA /.local/share/mime"
181- fi
178+ rm -rf " $XDG_DATA_HOME " /fonts
179+
180+ if [ -d " $SNAP_REAL_HOME /.local/share/fonts" ]; then
181+ ln -s " $SNAP_REAL_HOME /.local/share/fonts" " $XDG_DATA_HOME /fonts"
182182 fi
183183fi
184184
185+ # Build mime.cache needed for gtk and qt icon
186+ # @TODO: Re-enable this once we move to core22
187+ if [ " $needs_update " = true ]; then
188+ rm -rf " $SNAP_USER_DATA /.local/share/mime"
189+ # if [ ! -f "$SNAP/usr/share/mime/mime.cache" ]; then
190+ # if command -v update-mime-database >/dev/null; then
191+ # cp --preserve=timestamps -dR "$SNAP/usr/share/mime" "$SNAP_USER_DATA/.local/share"
192+ # async_exec update-mime-database "$SNAP_USER_DATA/.local/share/mime"
193+ # fi
194+ # fi
195+ fi
196+
185197# Gio modules and cache (including gsettings module)
186198export GIO_MODULE_DIR=" $SNAP_USER_COMMON /.cache/gio-modules"
187199function compile_giomodules {
0 commit comments