Nacre/spikes/webkit-egui/run/seq3.sh
astar76 63b39d7b7e webkit-spike: hidden run result, D-035..D-040, plans 08 WebKit engine S044-S055
GTK 4 host + transparent egui GLArea over WebKitGTK proven hidden (Xvfb + nested
niri): pick fall-through, real input and IME, egui menus over video, pacing equal
with and without the overlay. Spike fixes: IM client widget, wl-input Y flip,
SPIKE_EGUI=0 layout, URL trim.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-13 02:01:11 -06:00

16 lines
1.2 KiB
Shell
Executable file

#!/bin/bash
S=${SPIKE_RUN:-/tmp/webkit-spike}; HERE=$(cd "$(dirname "$0")" && pwd)
O=$1; shift
SOFT="LIBGL_ALWAYS_SOFTWARE=1 WEBKIT_DMABUF_RENDERER_FORCE_SHM=1 GTK_A11Y=none GDK_DEBUG=no-portals GSK_RENDERER=gl NO_AT_BRIDGE=1"
$HERE/spike.sh $O $SOFT SPIKE_URL=https://en.wikipedia.org/wiki/Web_browser "$@"
source $S/env; export WL_INPUT_FLIP_Y=1
W=$HERE/../target/release/wl-input
c() { echo "$*" >> $O/cmd; }
xy() { python3 -c "import json,sys;a=json.load(open('$O/$1.json'));a=json.loads(a) if isinstance(a,str) else a;print(int(a[0]),int(a[1])+46)"; }
sleep 9
c 'js link (()=>{const i=document.querySelector("#mw-content-text p a");const r=i.getBoundingClientRect();return JSON.stringify([r.x+r.width/2,r.y+r.height/2])})()'; sleep 1; read X Y < <(xy link)
$W winit click $X $Y right; sleep 1; c state ctx; c shot ctx_link; sleep 1
read CX CY < <(python3 -c "import json;s=json.load(open('$O/ctx.json'));print(int(s['ctx_menu']['x'])+60,int(s['ctx_menu']['y'])+16)")
$W winit click $CX $CY; sleep 3; c state ctx_opened; sleep 0.5
c quit; exit
$W winit ime 日本 1.5 >$O/ime_url.log 2>&1 & sleep 0.8; c shot ime_preedit_url; c state ime_pre_url; sleep 1.5; c state ime_url; sleep 0.5; c quit