#!/bin/sh
set -eu

# OpenPencil is a Tauri (WebKitGTK) app staged by apply_extra under
# /app/extra/usr; /app/extra/bin/openpencil is a stable symlink to whatever
# upstream named the launcher in the .deb, and its name is what the window class
# ends up as. Everything it links against - webkit2gtk-4.1, gtk-3, libsoup-3,
# cairo, gdk-pixbuf, fontconfig - comes from org.gnome.Platform.
#
# Documents opened through the file-chooser portal, the editor's own state and
# its settings go to the XDG data/config directories, which Flatpak points at
# ~/.var/app/dev.openpencil.OpenPencil.

# WebKitGTK's DMABUF renderer paints a blank window under many drivers inside the
# Flatpak sandbox. Disabling it is the reliable default for a WebKitGTK app.
export WEBKIT_DISABLE_DMABUF_RENDERER=1

exec /app/extra/bin/openpencil "$@"
