Fix #860: focus() on a XUL dialog has no effect

kmeleon11_branch
boisso 16 years ago
parent d1d94dd5d2
commit 7c5080baf0
  1. 23
      k-meleon/BrowserFrameGlue.cpp
  2. 4
      k-meleon/default/pref/kmeleon.js

@ -437,7 +437,7 @@ void CBrowserFrame::BrowserFrameGlueObj::SetBrowserPositionAndSize(PRInt32 aX, P
void CBrowserFrame::BrowserFrameGlueObj::SetFocus(){
METHOD_PROLOGUE(CBrowserFrame, BrowserFrameGlueObj)
//if (!::IsChild(pThis->m_hWnd,::GetFocus()))
//pThis->SetFocus();
// pThis->BringWindowToTop();
pThis->m_wndBrowserView.mBaseWindow->SetFocus();
}
@ -457,7 +457,7 @@ void CBrowserFrame::BrowserFrameGlueObj::FocusAvailable(PRBool *aFocusAvail)
void CBrowserFrame::BrowserFrameGlueObj::ShowBrowserFrame(PRBool aShow)
{
METHOD_PROLOGUE(CBrowserFrame, BrowserFrameGlueObj)
if(aShow)
{
if (pThis->m_bSizeOnLoad)
@ -486,28 +486,15 @@ void CBrowserFrame::BrowserFrameGlueObj::GetBrowserFrameVisibility(PRBool *aVisi
{
METHOD_PROLOGUE(CBrowserFrame, BrowserFrameGlueObj)
// Is the current BrowserFrame the active one?
/*// Is the current BrowserFrame the active one?
CWnd *pWnd = GetActiveWindow();
if (!pWnd || pWnd->m_hWnd != pThis->m_hWnd)
{
*aVisible = PR_FALSE;
return;
}
if (pThis->IsIconic() || !pThis->IsWindowVisible()) {
*aVisible = PR_FALSE;
return;
}
// We're the active one
//Return FALSE if we're minimized
WINDOWPLACEMENT wpl;
pThis->GetWindowPlacement(&wpl);
}*/
if ((wpl.showCmd == SW_NORMAL) || (wpl.showCmd == SW_MAXIMIZE))
*aVisible = PR_TRUE;
else
*aVisible = PR_FALSE;
*aVisible = pThis->IsIconic() || !pThis->IsWindowVisible() ? PR_FALSE : PR_TRUE;
}
PRBool CBrowserFrame::BrowserFrameGlueObj::CreateNewBrowserFrame(PRUint32 chromeMask,

@ -209,4 +209,8 @@ pref("browser.downloadmanager.behavior", 0);
// Show XUL error pages instead of alerts for errors
pref("browser.xul.error_pages.enabled", true);
// Mouse wheel zoom
pref("mousewheel.withcontrolkey.action",3);
// Prevent window to steal the focus when loading
pref("dom.disable_window_flip", true);

Loading…
Cancel
Save