AtlatestRepositorysigil-wm
1
#!/usr/bin/env bash2
# Sourced by the real-client example test after its second client takes focus.3
msg() { bash scripts/msg "$SIGIL_WM_REPL" "$1"; }4
msg '(begin (set-key-hook! host forward) (emulate-key! host 1 30 #t) (emulate-key! host 1 30 #f))'5
wait_log "build/receipts/$manager-red.log" 'CLIENT_KEY=30,0'6
msg '(begin (set-key-hook! host (lambda (event) (if (= (input-event-code event) 31) (replace (input-event event code: 32)) (forward event)))) (emulate-key! host 1 31 #t) (emulate-key! host 1 31 #f))'7
wait_log "build/receipts/$manager-red.log" 'CLIENT_KEY=32,0'8
if grep -q 'CLIENT_KEY=31,' "build/receipts/$manager-red.log"; then exit 1; fi9
msg '(begin (set-key-hook! host (lambda (event) (if (= (input-event-code event) 33) (drop) (forward event)))) (emulate-key! host 1 33 #t) (emulate-key! host 1 33 #f))'10
msg '(begin (set-key-hook! host (lambda (event) (if (= (input-event-state event) 0) (drop) (forward event)))) (emulate-key! host 1 34 #t) (emulate-key! host 1 34 #f))'11
wait_log "build/receipts/$manager-red.log" 'CLIENT_KEY=34,0'12
msg '(begin (set-key-hook! host (lambda (event) (error "fixture hook error"))) (emulate-key! host 1 35 #t) (emulate-key! host 1 35 #f))'13
msg '(begin (set-key-hook! host forward) (emulate-motion! host 1 160 180) (emulate-button! host 1 272 #t) (emulate-button! host 1 272 #f) (emulate-axis! host 1 0 12 1))'14
wait_log "build/receipts/$manager-red.log" 'CLIENT_BUTTON=272,0'15
wait_log "build/receipts/$manager-red.log" 'CLIENT_AXIS=0,12'16
msg '(begin (set-motion-hook! host (lambda (event) (replace (input-event event x: 250 y: 250))) 0 0 (list 0 0 0 0)) (emulate-motion! host 1 170 190))'17
wait_log "build/receipts/$manager-red.log" 'CLIENT_POINTER_MOTION=138,122'18
msg '(begin (set-motion-hook! host #f 0 0 (list 0 0 0 0)) (emulate-motion! host 1 180 200))'19
wait_log "build/receipts/$manager-red.log" 'CLIENT_POINTER_MOTION=68,72'20
if grep -Eq 'CLIENT_KEY=(33|35),' "build/receipts/$manager-red.log"; then exit 1; fi21
echo 'INPUT=PASS forward replace drop paired-release exception pointer button axis'22
msg '(let ((before (host-statistic host 0)) (pause (c-function (c-library #f) "usleep" (list ffi/uint) ffi/int))) (pause 500000) (>= (- (host-statistic host 0) before) 10))' | grep -q '(value #t)'23
echo 'FRAME_STALL=PASS native rendering continues during a blocked Sigil thread'