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

View file

@ -288,8 +288,19 @@ if echo "\$KIOSK_URL" | grep -q "localhost"; then
done done
fi 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} \\ exec ${CHROMIUM_BIN} \\
--kiosk \\ --kiosk \\
--window-position=0,0 \\
--window-size=\${SCREEN_W},\${SCREEN_H} \\
--noerrdialogs \\ --noerrdialogs \\
--disable-infobars \\ --disable-infobars \\
--disable-session-crashed-bubble \\ --disable-session-crashed-bubble \\
@ -298,7 +309,6 @@ exec ${CHROMIUM_BIN} \\
--check-for-update-interval=31536000 \\ --check-for-update-interval=31536000 \\
--autoplay-policy=no-user-gesture-required \\ --autoplay-policy=no-user-gesture-required \\
--no-first-run \\ --no-first-run \\
--start-fullscreen \\
--disable-pinch \\ --disable-pinch \\
--overscroll-history-navigation=0 \\ --overscroll-history-navigation=0 \\
--disable-translate \\ --disable-translate \\