Fix SeniorNet label clipping; auto-dismiss Chrome profile error dialog
This commit is contained in:
+16
-1
@@ -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_())
|
||||
|
||||
Reference in New Issue
Block a user