Skip to content

Fix cursor remains busy after launching windowed app#310

Merged
zooba merged 2 commits intopython:mainfrom
Jesse205:fix/cursor-busy
Apr 14, 2026
Merged

Fix cursor remains busy after launching windowed app#310
zooba merged 2 commits intopython:mainfrom
Jesse205:fix/cursor-busy

Conversation

@Jesse205
Copy link
Copy Markdown
Contributor

@Jesse205 Jesse205 commented Apr 10, 2026

This PR fixes a regression where the cursor remains stuck in a busy state.

The _WINDOWS macro is not defined in the pymanager project; it should be PY_WINDOWED. Therefore, I replaced defined(_WINDOWS) with PY_WINDOWED.

This resolves a previously fixed issue that has resurfaced: python/cpython#61492


Update: Relocated code to maintain a continuous cursor busy state during the pymanager-to-interpreter startup sequence.

@Jesse205 Jesse205 marked this pull request as draft April 10, 2026 21:31
@Jesse205 Jesse205 marked this pull request as ready for review April 10, 2026 21:43
@zooba
Copy link
Copy Markdown
Member

zooba commented Apr 13, 2026

Good catch. I think we also need to define the variable for the other kind of launcher, too, which lives in _msbuild.py in the top level directory. Want to take a look at that?

@Jesse205
Copy link
Copy Markdown
Contributor Author

Sorry, I'm not sure what you're referring to. In pymanager, _WINDOWS only appears here (this is the only location I could find via search).

@zooba
Copy link
Copy Markdown
Member

zooba commented Apr 14, 2026

The _msbuild.py file in the top of the repo is our build script, and it's where Py_WINDOWED is defined. But it's not been defined for the launcherw.exe (template that gets renamed for generating shortcuts), which means these ones won't benefit from this fix.

I can get to it when I get a chance, but it'd be good to fix it all in one PR.

@Jesse205
Copy link
Copy Markdown
Contributor Author

Jesse205 commented Apr 14, 2026

launcherw.exe appears to work correctly even without PY_WINDOWED. I just installed Python 3.14 using the released pymanager v26.1 and dragged my .pyzw file onto pythonw3.14.exe. The cursor behaves as expected. Using Process Explorer, I examined the process tree and found that there are no child processes under this pythonw3.14.exe. Additionally, the window it creates is exactly the one generated by my .pyzw file. This seems to differ from how pymanager works.

image

@zooba
Copy link
Copy Markdown
Member

zooba commented Apr 14, 2026

For runtimes with a compatible python3.dll, yes, we bypass the child process for speed (and can't do it for py.exe because that's already loaded one Python runtime). But if python3.dll is missing, or too old, then it'll launch the executable and we're in the same state.

@zooba
Copy link
Copy Markdown
Member

zooba commented Apr 14, 2026

I'll just take this as it is and file a new issue to fix the other launcher. Thanks for the contribution!

@zooba zooba merged commit aebc2b5 into python:main Apr 14, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants