summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/fhandler_console.cc
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-07-02 09:57:34 -0700
committerKaz Kylheku <kaz@kylheku.com>2016-07-02 09:57:34 -0700
commit5d50aea73aace09f914ff95d90b771270aef1ab8 (patch)
treee37a444b4285b6ac750f515359e88e89d64be656 /winsup/cygwin/fhandler_console.cc
parent023e7d13c458fbd874094d1d518b2169b123a8dc (diff)
downloadcygnal-5d50aea73aace09f914ff95d90b771270aef1ab8.tar.gz
cygnal-5d50aea73aace09f914ff95d90b771270aef1ab8.tar.bz2
cygnal-5d50aea73aace09f914ff95d90b771270aef1ab8.zip
Fix spawned process window not foregrounding.
This patch addresses an issue whereby the window of a process created with CreateProcess fails to come to the foreground. This occurs when the calling process itself hasn't run any Windows event processing loop. A repro test case is to make a program with a main, and and call CreateProcess to spawn calc.exe or notepad.exe before doing anything else. It turns out that a dummy call to TranslateMessage makes this issue goes away. If such a call is made before CreateProcess, then the spawned process' window comes up in the foreground as expected. * winsup/cygwin/Makefile.in (DLL_IMPORTS): We need to link in user32.dll to call TranslateMessage. Condense the multiple ${shell ...} call repetition with a foreach. * winsup/cygwin/spawn.cc (child_info_spawn::worker): Do the dummy TranslateMessage call before the section of code that calls CreateProcess or CreateProcessAsUser.
Diffstat (limited to 'winsup/cygwin/fhandler_console.cc')
0 files changed, 0 insertions, 0 deletions