Commit Graph
3 Commits
Author SHA1 Message Date
yetone b90e81da14 gui: on Linux without gst-plugins-good the masking demo shows her poster
On stock Omarchy (Arch + Hyprland, WebKitGTK 2.52.6, GStreamer 1.28.6
with gst-plugins-base and -bad only), opening the masking demo aborted
WebKitWebProcess about three seconds in, so the app's window went blank.
WebKitGTK gives every video, a muted one too, an audio sink it makes with
autoaudiosink ("GStreamer element autoaudiosink not found", then a NULL
g_signal_connect, then SIGABRT); that element is in gst-plugins-good.
canPlayType can't tell: an Ogg Theora copy, "probably" playable there,
crashed the same way, so no other format would do.

The Linux app now looks for libgstautodetect.so in GStreamer's plugin
folders (its variables' and the system's): GStreamer's core there and
autodetect in none of them means no video (webkitPlaysVideo). Settings
state says noVideo then, in the app only (magpie web plays in the user's
own browser), and the demo sets no src: she is her poster and the sheets
move on the frame clock, as when the video can't load. No GStreamer folder
found says nothing, and video stays on.

Run at this head (origin/main 0f053024f + this change; the runs were at
ec6c2de52 + this change, and 0f053024f changes only README and site/):
- mote: node --test masking-demo, masking-records: 110 pass, 0 fail
  (Chromium and WebKit; the new poster test in both).
- magpie-desktop (WSL, Ubuntu 24.04): go test -tags gtk3 -run
  'TestGstAutodetect|TestWebkitDefaults|TestRenderNodeOpens|TestSettings'
  ./internal/gui: ok.
- mote: GOOS=linux CGO_ENABLED=0 go vet -tags gtk3, GOOS=windows go vet
  and go vet of ./internal/gui: ok. gofmt -l: none.
- omarchy, the real check on the real system, from a test binary built
  at this head: webkitPlaysVideo() is false
  ([/usr/lib/gstreamer-1.0 /usr/lib64/gstreamer-1.0]); on magpie-desktop,
  which has gst-plugins-good, true.
- omarchy, WebKitGTK driven from Python on `magpie web`'s page: with the
  demo's webm src set, the web process aborts every time (core dumps
  23:07:33, 23:10:17, 23:12:59, and 23:18:30 with an .ogv); with no src,
  as this change does, it stays up and T runs (2.99 -> 4.39 s).
- Broken by hand: gstAutodetect returning true makes TestGstAutodetect
  red ("stock omarchy: gstAutodetect = true, want false"); demo.js setting
  src regardless makes the poster test red in both engines.

Not tried: clicking the demo row in the real desktop app on omarchy (no
pointer tool there); the app's half was checked through the same
WebKitGTK and the detection through the real folders, separately.
2026-10-28 07:31:02 +08:00
yetone 2d12ce98be gui: on Linux without a GPU WebKitGTK draws without accelerated compositing (#2827)
zhang-4411 (#2827): under xrdp/X11 with no GPU the Routing page's web
process took 459%-830% CPU, and 23% with WEBKIT_DISABLE_COMPOSITING_MODE=1,
looking the same. With no render node EGL can open, WebKitGTK's
compositing falls back to Mesa's llvmpipe, which rasterises and blends
every layer on the CPU with a thread per core.

webkitDefaults already turned compositing off under Wayland (myxxts's
flicker). It now does so under X11 too when gpuReachable finds no
/dev/dri/renderD* this process can open (none there, or each refused:
the xrdp user outside the render group). X11 with a GPU is left as it
was, and a user who set WEBKIT_DISABLE_COMPOSITING_MODE or
WEBKIT_DISABLE_DMABUF_RENDERER keeps what they set
(WEBKIT_DISABLE_COMPOSITING_MODE=0 turns compositing back on).

Run:
- gofmt -l internal/gui: nothing
- go vet ./internal/gui; GOOS=linux go vet -tags nogui ./...;
  GOOS=windows go vet -tags nogui ./...: clean
- go test -tags nogui ./internal/gui -timeout 45m (macOS):
  ok github.com/yetone/magpie/internal/gui 1013.214s
- webkit_linux*.go build only on Linux, so the tests ran there:
  CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go test -c -tags nogui, run in
  docker golang:1.26.8: TestWebkitDefaults and TestRenderNodeOpens PASS.
- Broken by hand (gpu() || true in webkitDefaultsFor): FAIL
  "x11 without a gpu (xrdp): WEBKIT_DISABLE_COMPOSITING_MODE="", want "1"".
  Restored.

Not tried: a real xrdp session, llvmpipe or WebKitGTK. gpuReachable was
not run on a machine where the render node is refused; the CPU figures
are the reporter's.
2026-10-20 20:23:53 +08:00
yetone 58dbd06289 linux: the window no longer flickers under Wayland — WebKitGTK draws the pages without accelerated compositing there (myxxts on Discord: Fedora 44, KDE, Wayland, AMD Radeon 780M, the UI flickered on every interaction). Wails turns DMA-BUF off for NVIDIA only; the reporter tried both WEBKIT_DISABLE_DMABUF_RENDERER=1 and WEBKIT_DISABLE_COMPOSITING_MODE=1, both stopped it and the second was smoother. Run now sets WEBKIT_DISABLE_COMPOSITING_MODE=1 before the first webview when the session is Wayland (XDG_SESSION_TYPE or WAYLAND_DISPLAY) and the user set neither variable; X11 is left as it was, and WEBKIT_DISABLE_COMPOSITING_MODE=0 turns compositing back on. TestWebkitDefaults (Wayland, X11, a user's own setting) passes in a linux/arm64 container. Not tried on a Linux desktop here; the fix is the reporter's own tested setting. go vet, builds (darwin, GOOS=linux, GOOS=windows) and go test -tags nogui -count=1 ./... under a temp HOME pass (TestProvidersAnswerWhileListsComeIn, TestUserPath and TestClaudeSignedOut flaked under load and pass alone). 2026-10-04 17:48:54 +08:00