#!/bin/sh
set -eu

# mqtt-viewer is a single Wails (Go + WebKitGTK) binary staged by apply_extra to
# /app/extra/mqtt-viewer/bin. Its frontend assets are embedded in the executable,
# so there is nothing to resolve relative to it and no resource dir to point at.
# It links only against libraries in org.gnome.Platform (webkit2gtk-4.1, gtk-3,
# libsoup-3, glib). Flatpak redirects the XDG base dirs into the per-app data
# dir, so the message database and settings stay inside the sandbox.

# WebKitGTK's DMABUF renderer paints a blank window under many drivers inside
# the Flatpak sandbox; the compositing path is the reliable default here.
export WEBKIT_DISABLE_DMABUF_RENDERER=1

exec /app/extra/mqtt-viewer/bin/mqtt-viewer "$@"
