Fix kiosk fullscreen: detect resolution at runtime, replace --start-fullscreen with --window-position/--window-size

This commit is contained in:
copilot-swe-agent[bot] 2026-06-20 04:46:15 +00:00 committed by GitHub
parent 852dccaec2
commit f47b52f21e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 45 additions and 25 deletions

View file

@ -294,30 +294,40 @@ if echo "\$KIOSK_URL" | grep -q "localhost"; then
done
fi
exec ${CHROMIUM_BIN} \
--kiosk \
--noerrdialogs \
--disable-infobars \
--disable-session-crashed-bubble \
--disable-features=TranslateUI \
--disable-component-update \
--check-for-update-interval=31536000 \
--autoplay-policy=no-user-gesture-required \
--no-first-run \
--start-fullscreen \
--disable-pinch \
--overscroll-history-navigation=0 \
--disable-translate \
--disable-sync \
--disable-background-networking \
--disable-default-apps \
--disable-extensions \
--disable-hang-monitor \
--disable-popup-blocking \
--disable-prompt-on-repost \
--metrics-recording-only \
--safebrowsing-disable-auto-update \
--ignore-certificate-errors \
# Detect screen resolution so Chromium fills the display on minimal X11 (no WM)
SCREEN_RES=\$(xrandr 2>/dev/null | grep ' connected' | grep -oE '[0-9]+x[0-9]+' | head -1)
SCREEN_W=\${SCREEN_RES%%x*}
SCREEN_H=\${SCREEN_RES##*x}
if [ -z "\$SCREEN_W" ] || [ -z "\$SCREEN_H" ]; then
SCREEN_W=1920
SCREEN_H=1080
fi
exec ${CHROMIUM_BIN} \\
--kiosk \\
--window-position=0,0 \\
--window-size=\${SCREEN_W},\${SCREEN_H} \\
--noerrdialogs \\
--disable-infobars \\
--disable-session-crashed-bubble \\
--disable-features=TranslateUI \\
--disable-component-update \\
--check-for-update-interval=31536000 \\
--autoplay-policy=no-user-gesture-required \\
--no-first-run \\
--disable-pinch \\
--overscroll-history-navigation=0 \\
--disable-translate \\
--disable-sync \\
--disable-background-networking \\
--disable-default-apps \\
--disable-extensions \\
--disable-hang-monitor \\
--disable-popup-blocking \\
--disable-prompt-on-repost \\
--metrics-recording-only \\
--safebrowsing-disable-auto-update \\
--ignore-certificate-errors \\
"\$KIOSK_URL"
KIOSKEOF

View file

@ -288,8 +288,19 @@ if echo "\$KIOSK_URL" | grep -q "localhost"; then
done
fi
# Detect screen resolution so Chromium fills the display on minimal X11 (no WM)
SCREEN_RES=\$(xrandr 2>/dev/null | grep ' connected' | grep -oE '[0-9]+x[0-9]+' | head -1)
SCREEN_W=\${SCREEN_RES%%x*}
SCREEN_H=\${SCREEN_RES##*x}
if [ -z "\$SCREEN_W" ] || [ -z "\$SCREEN_H" ]; then
SCREEN_W=1920
SCREEN_H=1080
fi
exec ${CHROMIUM_BIN} \\
--kiosk \\
--window-position=0,0 \\
--window-size=\${SCREEN_W},\${SCREEN_H} \\
--noerrdialogs \\
--disable-infobars \\
--disable-session-crashed-bubble \\
@ -298,7 +309,6 @@ exec ${CHROMIUM_BIN} \\
--check-for-update-interval=31536000 \\
--autoplay-policy=no-user-gesture-required \\
--no-first-run \\
--start-fullscreen \\
--disable-pinch \\
--overscroll-history-navigation=0 \\
--disable-translate \\