fix: remove --no-sandbox, dynamic screen resolution detection

This commit is contained in:
2026-05-22 13:03:11 +00:00
parent a61f66e57a
commit e34ea8f7c8
+7 -3
View File
@@ -19,8 +19,9 @@ BOOKMARKS_FILE = "/home/jgitta/kiosk-browser/bookmarks.json"
CDP_PORT = 9222 CDP_PORT = 9222
TOOLBAR_H = 72 # single row — was 142 (82 + 60) TOOLBAR_H = 72 # single row — was 142 (82 + 60)
TOP_H = TOOLBAR_H TOP_H = TOOLBAR_H
SCREEN_W = 1920 # Screen size is detected dynamically in main() after QApplication starts
SCREEN_H = 1080 SCREEN_W = 1920 # overwritten at runtime
SCREEN_H = 1080 # overwritten at runtime
# ── Colour palette ──────────────────────────────────────────────── # ── Colour palette ────────────────────────────────────────────────
TOOLBAR_COLOR = "#1a3a5c" TOOLBAR_COLOR = "#1a3a5c"
@@ -622,7 +623,6 @@ def launch_chrome():
"--disable-background-networking", "--disable-background-networking",
"--disable-extensions", "--disable-extensions",
"--disable-gpu", "--disable-gpu",
"--no-sandbox",
"--disable-blink-features=AutomationControlled", "--disable-blink-features=AutomationControlled",
"--disable-dev-shm-usage", "--disable-dev-shm-usage",
"--user-data-dir=/home/jgitta/chromium-kiosk", "--user-data-dir=/home/jgitta/chromium-kiosk",
@@ -638,6 +638,10 @@ def launch_chrome():
# ── Main ────────────────────────────────────────────────────────── # ── Main ──────────────────────────────────────────────────────────
if __name__ == "__main__": if __name__ == "__main__":
app = QApplication(sys.argv) app = QApplication(sys.argv)
# Detect actual screen resolution at runtime
global SCREEN_W, SCREEN_H
_geo = app.primaryScreen().geometry()
SCREEN_W, SCREEN_H = _geo.width(), _geo.height()
app.setApplicationName("SeniorNet") app.setApplicationName("SeniorNet")
p = app.palette(); p.setColor(QPalette.Window, QColor("#1a3a5c")); app.setPalette(p) p = app.palette(); p.setColor(QPalette.Window, QColor("#1a3a5c")); app.setPalette(p)