gh-118293: Suppress mouse cursor feedback when launching Windows processes with multiprocessing (GH-118315)

This commit is contained in:
Henrik Tunedal 2024-04-28 23:10:44 +02:00 committed by GitHub
parent f5b7e397c0
commit 133c1a7cdb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 71 additions and 1 deletions

View file

@ -3,6 +3,7 @@ import msvcrt
import signal
import sys
import _winapi
from subprocess import STARTUPINFO, STARTF_FORCEOFFFEEDBACK
from .context import reduction, get_spawning_popen, set_spawning_popen
from . import spawn
@ -74,7 +75,8 @@ class Popen(object):
try:
hp, ht, pid, tid = _winapi.CreateProcess(
python_exe, cmd,
None, None, False, 0, env, None, None)
None, None, False, 0, env, None,
STARTUPINFO(dwFlags=STARTF_FORCEOFFFEEDBACK))
_winapi.CloseHandle(ht)
except:
_winapi.CloseHandle(rhandle)