|
|
|
@@ -3245,17 +3245,10 @@ bool JUCE_CALLTYPE Process::isForegroundProcess() |
|
|
|
if (fg == 0)
|
|
|
|
return true;
|
|
|
|
|
|
|
|
// when running as a plugin in IE8, the browser UI runs in a different process to the plugin, so
|
|
|
|
// process ID isn't a reliable way to check if the foreground window belongs to us - instead, we
|
|
|
|
// have to see if any of our windows are children of the foreground window
|
|
|
|
fg = GetAncestor (fg, GA_ROOT);
|
|
|
|
|
|
|
|
for (int i = ComponentPeer::getNumPeers(); --i >= 0;)
|
|
|
|
if (HWNDComponentPeer* const wp = dynamic_cast<HWNDComponentPeer*> (ComponentPeer::getPeer (i)))
|
|
|
|
if (wp->isInside (fg))
|
|
|
|
return true;
|
|
|
|
DWORD processID = 0;
|
|
|
|
GetWindowThreadProcessId (fg, &processID);
|
|
|
|
|
|
|
|
return false;
|
|
|
|
return (processID == GetCurrentProcessId());
|
|
|
|
}
|
|
|
|
|
|
|
|
// N/A on Windows as far as I know.
|
|
|
|
|