From 32a8d07644dd03b4099519328bdd7d77ef48e1db Mon Sep 17 00:00:00 2001 From: Caleb Allen Date: Fri, 6 Mar 2026 09:53:46 -0500 Subject: [PATCH] fixed makefile to workaround obfuscation bug, changed gpu policy to fix wayland issue --- Makefile | 6 +++--- main.go | 8 +++++++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 4d4e09c..1737374 100644 --- a/Makefile +++ b/Makefile @@ -3,16 +3,16 @@ COMMIT ?= $(shell git rev-parse --short HEAD 2>/dev/null || echo "unknown") LDFLAGS := -X 'main.version=$(VERSION)' -X 'main.commit=$(COMMIT)' dev: setup generate clean - WEBKIT_DISABLE_DMABUF_RENDERER=1 go tool wails dev -tags webkit2_41 -loglevel Debug -v 2 + go tool wails dev -tags webkit2_41 -loglevel Debug -v 2 dev-debug: setup generate clean - WEBKIT_DISABLE_DMABUF_RENDERER=1 YJ_LOG_LEVEL=debug go tool wails dev -tags webkit2_41 -loglevel Debug -v 2 + YJ_LOG_LEVEL=debug go tool wails dev -tags webkit2_41 -loglevel Debug -v 2 build-dev: generate go tool wails build -tags webkit2_41 -debug -clean -ldflags "$(LDFLAGS)" build-prod: generate - go tool wails build -tags webkit2_41 -clean -obfuscated -upx -ldflags "-s -w $(LDFLAGS)" + go tool wails build -tags webkit2_41 -clean -upx -ldflags "-s -w $(LDFLAGS)" build-frontend: cd frontend && pnpm install && pnpm build diff --git a/main.go b/main.go index 1bd7071..f0b2e7e 100644 --- a/main.go +++ b/main.go @@ -29,6 +29,12 @@ var ( var frontendDistAssets embed.FS func main() { + // Work around WebKitGTK DMABuf rendering crashes on certain + // Wayland compositor / GPU-driver combinations. + if os.Getenv("WEBKIT_DISABLE_DMABUF_RENDERER") == "" { + _ = os.Setenv("WEBKIT_DISABLE_DMABUF_RENDERER", "1") + } + isDev := dev.IsDev // create sLogger loglevel := resolveLogLevel(isDev) @@ -83,7 +89,7 @@ func main() { MaxWidth: 0, MaxHeight: 0, Linux: &linux.Options{ - WebviewGpuPolicy: linux.WebviewGpuPolicyAlways, + WebviewGpuPolicy: linux.WebviewGpuPolicyOnDemand, }, })