Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bootloader: Windows: shorten the duration of spinning-wheel cursor #8359

Merged
merged 1 commit into from Mar 15, 2024

Commits on Mar 15, 2024

  1. bootloader: Windows: shorten the duration of spinning-wheel cursor

    When using windowed/noconsole mode, attempt to shorten the duration
    of the spinning-wheel cursor that Windows uses to indicate that the
    process is starting.
    
    For programs using `/SUBSYSTEM:WINDOWS`, Windows displays the
    spinning wheel cursor for a fixed amount of time, or until the
    process makes use of UI functions (creates a window, uses message
    queue).
    
    In PyInstaller onefile applications, the parent process displays
    a window only if splash screen is used. Therefore, the spinning
    wheel cursor might be still shown well after the child process
    displays its UI. To prevent this, post and receive a message
    using message queue, which apparently suffices to convince Windows
    that the process is alive. Do this right before we spawn the child
    process, i.e., after the parent process finishes unpacking the
    program; this is to ensure that the spinning-wheel cursor is
    displayed for the whole duration of unpacking.
    
    In onedir applications, the spinning wheel should generally not
    be an issue (as there is only one process), except for
    background-style applications that do not display any UI. Such
    progams will appear to start faster if we have Windows hide
    the spinning-wheel cursor before we launch the python
    interpreter. So add calls using message queue in that codepath
    as well.
    
    We use the same combination of `PostMessage` and `GetMessage`
    that can also be found in python executable:
    https://github.com/python/cpython/blob/v3.12.2/PC/launcher.c#L765-L779
    rokm committed Mar 15, 2024
    Configuration menu
    Copy the full SHA
    1a9d91e View commit details
    Browse the repository at this point in the history