From e34ea8f7c87218ca2e29a945fb3af501920e2414 Mon Sep 17 00:00:00 2001 From: Joe Gitta Date: Fri, 22 May 2026 13:03:11 +0000 Subject: [PATCH] fix: remove --no-sandbox, dynamic screen resolution detection --- browser.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/browser.py b/browser.py index fb3d0b7..a14e0d7 100755 --- a/browser.py +++ b/browser.py @@ -19,8 +19,9 @@ BOOKMARKS_FILE = "/home/jgitta/kiosk-browser/bookmarks.json" CDP_PORT = 9222 TOOLBAR_H = 72 # single row — was 142 (82 + 60) TOP_H = TOOLBAR_H -SCREEN_W = 1920 -SCREEN_H = 1080 +# Screen size is detected dynamically in main() after QApplication starts +SCREEN_W = 1920 # overwritten at runtime +SCREEN_H = 1080 # overwritten at runtime # ── Colour palette ──────────────────────────────────────────────── TOOLBAR_COLOR = "#1a3a5c" @@ -622,7 +623,6 @@ def launch_chrome(): "--disable-background-networking", "--disable-extensions", "--disable-gpu", - "--no-sandbox", "--disable-blink-features=AutomationControlled", "--disable-dev-shm-usage", "--user-data-dir=/home/jgitta/chromium-kiosk", @@ -638,6 +638,10 @@ def launch_chrome(): # ── Main ────────────────────────────────────────────────────────── if __name__ == "__main__": 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") p = app.palette(); p.setColor(QPalette.Window, QColor("#1a3a5c")); app.setPalette(p)