From bed8887324c9ca21a8eb57530f98317f900651dc Mon Sep 17 00:00:00 2001 From: Reimar Bauer Date: Wed, 15 Jul 2026 12:35:29 +0200 Subject: [PATCH] bring main window to front --- tutorials/utils/__init__.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tutorials/utils/__init__.py b/tutorials/utils/__init__.py index f3a1c50a3..deb771e9f 100644 --- a/tutorials/utils/__init__.py +++ b/tutorials/utils/__init__.py @@ -752,6 +752,15 @@ def show_other_widgets(): switch_window(presses=3) +def bring_main_window_to_front(): + # activate the MSUI main window. + if sys.platform == 'darwin': + pag.hotkey(WIN, 'up') + else: + pag.hotkey(CTRL, 'up') + pag.sleep(1) + + def msui_full_screen_and_open_first_view(view_cmd='h'): """ Open the first view and go full screen in MSUI. @@ -763,6 +772,8 @@ def msui_full_screen_and_open_first_view(view_cmd='h'): """ pag.sleep(1) if view_cmd is not None: + # The view shortcut is window-scoped + bring_main_window_to_front() pag.hotkey(CTRL, view_cmd) pag.sleep(1) create_tutorial_images()