From 08f296ceb34f5beb749e2a204c134308c60f8e87 Mon Sep 17 00:00:00 2001 From: jgitta Date: Fri, 22 May 2026 00:52:18 +0000 Subject: [PATCH] Fix SeniorNet label clipping; auto-dismiss Chrome profile error dialog --- browser.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/browser.py b/browser.py index 408324f..9dcff4d 100755 --- a/browser.py +++ b/browser.py @@ -377,7 +377,7 @@ class KioskOverlay(QWidget): bar = QWidget(); bar.setFixedHeight(TOOLBAR_H) bar.setStyleSheet(f"background:{TOOLBAR_COLOR};") tl = QHBoxLayout(bar) - tl.setContentsMargins(16, 7, 16, 7); tl.setSpacing(10) + tl.setContentsMargins(24, 7, 16, 7); tl.setSpacing(10) # Brand label brand = QLabel("SeniorNet") @@ -534,9 +534,24 @@ if __name__ == "__main__": chrome_proc = launch_chrome() + def dismiss_chrome_dialogs(): + """ + Chrome sometimes shows a 'Profile error occurred' dialog on startup. + This runs in the background and closes it automatically so the senior + never sees it. We try a few times over 10 seconds to catch it. + """ + for _ in range(10): + time.sleep(1) + subprocess.run( + ["xdotool", "search", "--name", "Profile error occurred", + "key", "Return"], + stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL + ) + def init_cdp(): if cdp.wait_ready(timeout=30): print("CDP ready — kiosk running") + dismiss_chrome_dialogs() threading.Thread(target=init_cdp, daemon=True).start() sys.exit(app.exec_())