Fix early activation/focus problem on Windows, patch by Oliver Yeoh. b=220900 r=me r=robert sr=brendan

This commit is contained in:
mats.palmgren%bredband.net 2006-10-11 17:30:01 +00:00
Родитель 94784ecaa2
Коммит d7ded9a678
3 изменённых файлов: 9 добавлений и 13 удалений

Просмотреть файл

@ -571,14 +571,10 @@ struct MessageWindow {
cmdlen + strlen(cmdbuf + cmdlen + 1) + 2,
(void*) cmdbuf
};
HWND newWin = (HWND)::SendMessage( mHandle, WM_COPYDATA, 0, (LPARAM)&cds );
if ( newWin ) {
// Restore the window if it is minimized.
if ( ::IsIconic( newWin ) ) {
::ShowWindow( newWin, SW_RESTORE );
}
::SetForegroundWindow( newWin );
}
// Bring the already running Mozilla process to the foreground.
// nsWindow will restore the window (if minimized) and raise it.
::SetForegroundWindow( mHandle );
::SendMessage( mHandle, WM_COPYDATA, 0, (LPARAM)&cds );
free (cmdbuf);
return NS_OK;
}

Просмотреть файл

@ -2242,7 +2242,7 @@ NS_METHOD nsWindow::SetFocus(PRBool aRaise)
// Uniconify, if necessary
HWND toplevelWnd = GetTopLevelHWND(mWnd);
if (::IsIconic(toplevelWnd))
::OpenIcon(toplevelWnd);
::ShowWindow(toplevelWnd, SW_RESTORE);
::SetFocus(mWnd);
#ifdef WINCE

Просмотреть файл

@ -911,10 +911,10 @@ struct MessageWindow {
// SendRequest: Pass string via WM_COPYDATA to message window.
NS_IMETHOD SendRequest( const char *cmd ) {
COPYDATASTRUCT cds = { 0, ::strlen( cmd ) + 1, (void*)cmd };
HWND newWin = (HWND)::SendMessage( mHandle, WM_COPYDATA, 0, (LPARAM)&cds );
if ( newWin ) {
::SetForegroundWindow( newWin );
}
// Bring the already running Mozilla process to the foreground.
// nsWindow will restore the window (if minimized) and raise it.
::SetForegroundWindow( mHandle );
::SendMessage( mHandle, WM_COPYDATA, 0, (LPARAM)&cds );
return NS_OK;
}