select terminal before requesting dialog

This commit is contained in:
chombier 2001-05-17 10:15:39 +00:00
parent 211263222b
commit 5883e1a691
1 changed files with 20 additions and 3 deletions

View File

@ -510,13 +510,28 @@ static void AddPassToKeychain(const char *prompt, StringPtr password)
#endif
/*
* ActivateTerminal
*/
static void ActivateTerminal(WindowPtr wind)
{
if ( wind && FrontWindow() != wind ) {
SelectWindow( wind );
do {
EventRecord theEvent;
if ( WaitNextEvent(activMask | updateMask, &theEvent, 0, 0L) ) {
HandleEvent(&theEvent);
}
} while ( FrontWindow() != wind );
}
}
/*
* SSH2PasswordDialog
*/
Boolean SSH2PasswordDialog(const char *prompt, StringPtr password)
Boolean SSH2PasswordDialog(const char *prompt, StringPtr password, WindowPtr term)
{
DialogPtr dlog;
short item = 0;
@ -537,6 +552,8 @@ Boolean SSH2PasswordDialog(const char *prompt, StringPtr password)
InteractWithUser( true, 128, 128 );
ActivateTerminal(term);
SetUpMovableModalMenus();
internalBufferFilterUPP = NewModalFilterProc(InternalBufferFilter);
*password = '\0';