8000 gh-118293: Suppress mouse cursor change in multiprocessing · python/cpython@47b4180 · GitHub
[go: up one dir, main page]

Skip to content

Commit 47b4180

Browse files
committed
gh-118293: Suppress mouse cursor change in multiprocessing
1 parent 463c20d commit 47b4180

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

Lib/multiprocessing/popen_spawn_win32.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import signal
44
import sys
55
import _winapi
6+
from subprocess import STARTUPINFO
67

78
from .context import reduction, get_spawning_popen, set_spawning_popen
89
from . import spawn
@@ -18,6 +19,7 @@
1819
TERMINATE = 0x10000
1920
WINEXE = (sys.platform == 'win32' and getattr(sys, 'frozen', False))
2021
WINSERVICE = sys.executable.lower().endswith("pythonservice.exe")
22+
STARTF_FORCEOFFFEEDBACK = 0x80
2123

2224

2325
def _path_eq(p1, p2):
@@ -74,7 +76,8 @@ def __init__(self, process_obj):
7476
try:
7577
hp, ht, pid, tid = _winapi.CreateProcess(
7678
python_exe, cmd,
77-
None, None, False, 0, env, None, None)
79+
None, None, False, 0, env, None,
80+
STARTUPINFO(dwFlags=STARTF_FORCEOFFFEEDBACK))
7881
_winapi.CloseHandle(ht)
7982
except:
8083
_winapi.CloseHandle(rhandle)
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
The `multiprocessing` module now passes the `STARTF_FORCEOFFFEEDBACK` flag
2+
when spawning processes to tell Windows not to change the mouse cursor.

0 commit comments

Comments
 (0)
0