From f19cf7e0e06dbb6b9c71f035a6f57ea12c2d8a91 Mon Sep 17 00:00:00 2001 From: Dor-sketch Date: Mon, 8 Jul 2024 13:38:32 +0300 Subject: [PATCH] Try to fix bug in IOS Ready to start screen --- static/3d.tmpl | 11 +++++++++-- static/default.tmpl | 11 +++++++++-- static/mobile.tmpl | 11 +++++++++-- static/noctx.tmpl | 11 +++++++++-- 4 files changed, 36 insertions(+), 8 deletions(-) diff --git a/static/3d.tmpl b/static/3d.tmpl index fe39196..7ab579d 100644 --- a/static/3d.tmpl +++ b/static/3d.tmpl @@ -118,8 +118,15 @@ async def custom_site(): print(""" * Waiting for media user engagement : please click/touch page * """) - while not platform.window.MM.UME: - await asyncio.sleep(.1) + waiting = True + while waiting: + for event in pygame.event.get(): + if event.type == pygame.QUIT: + pygame.quit() + exit() + elif event.type == pygame.MOUSEBUTTONDOWN or event.type == pygame.KEYDOWN: + waiting = False + await asyncio.sleep(0.1) # start async top level machinery if not started and add a console in any case if requested. await TopLevel_async_handler.start_toplevel(platform.shell, console=window.python.config.debug) diff --git a/static/default.tmpl b/static/default.tmpl index b2576c9..17a911e 100644 --- a/static/default.tmpl +++ b/static/default.tmpl @@ -176,8 +176,15 @@ async def custom_site(): print(""" * Waiting for media user engagement : please click/touch page * """) - while not platform.window.MM.UME: - await asyncio.sleep(.1) + waiting = True + while waiting: + for event in pygame.event.get(): + if event.type == pygame.QUIT: + pygame.quit() + exit() + elif event.type == pygame.MOUSEBUTTONDOWN or event.type == pygame.KEYDOWN: + waiting = False + await asyncio.sleep(0.1) # cleanup screen.fill( (0,0,0,0) ) diff --git a/static/mobile.tmpl b/static/mobile.tmpl index ca9585a..a089fd1 100644 --- a/static/mobile.tmpl +++ b/static/mobile.tmpl @@ -194,8 +194,15 @@ async def custom_site(): """) - while not platform.window.MM.UME: - await asyncio.sleep(.1) + waiting = True + while waiting: + for event in pygame.event.get(): + if event.type == pygame.QUIT: + pygame.quit() + exit() + elif event.type == pygame.MOUSEBUTTONDOWN or event.type == pygame.KEYDOWN: + waiting = False + await asyncio.sleep(0.1) # unlock async for main.py loop ( 2nd asyncio.run call ) diff --git a/static/noctx.tmpl b/static/noctx.tmpl index bc0f7dc..e193ca9 100644 --- a/static/noctx.tmpl +++ b/static/noctx.tmpl @@ -116,8 +116,15 @@ async def custom_site(): print(""" * Waiting for media user engagement : please click/touch page * """) - while not platform.window.MM.UME: - await asyncio.sleep(.1) + waiting = True + while waiting: + for event in pygame.event.get(): + if event.type == pygame.QUIT: + pygame.quit() + exit() + elif event.type == pygame.MOUSEBUTTONDOWN or event.type == pygame.KEYDOWN: + waiting = False + await asyncio.sleep(0.1) # start async top level machinery if not started and add a console in any case if requested. await TopLevel_async_handler.start_toplevel(platform.shell, console=window.python.config.debug)