зеркало из https://github.com/mozilla/pjs.git
Fix early activation/focus problem on Windows, patch by Oliver Yeoh. b=220900 r=me r=robert sr=brendan
This commit is contained in:
Родитель
94784ecaa2
Коммит
d7ded9a678
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче