Fix high CPU usage with animated elements

import/tags/kmeleon75
boisso 8 years ago
parent 2b6299c49b
commit d020dec68e
  1. 8
      k-meleon/BrowserFrmTab.cpp
  2. 10
      k-meleon/BrowserWindow.cpp
  3. 1
      k-meleon/BrowserWindow.h

@ -372,13 +372,16 @@ void CBrowserFrmTab::SetActiveBrowser(CBrowserTab* aNewActiveTab)
m_wndCBrowserTab->SetTypedLocation(!m_wndUrlBar.GetIsTyped() ? _T("") : m_wndUrlBar.GetEnteredURL());
m_pPreviousSelectedTab = m_wndCBrowserTab;
focus = m_wndCBrowserTab->IsChild(GetFocus());
m_wndCBrowserTab->GetBrowserWrapper()->SetVisible(false);
PostMessage(UWM_UPDATESESSIONHISTORY, 0, 0);
}
//SendMessage(WM_SWITCHTAB, (WPARAM)m_wndCBrowserTab, (LPARAM)aNewActiveTab);
theApp.plugins.SendMessage("*", "*", "SwitchTab", (long)m_wndCBrowserTab->GetSafeHwnd(), (long)aNewActiveTab->GetSafeHwnd());
CBrowserTab* oldTab = m_wndCBrowserTab;
m_iCBrowserView = aNewActiveTab->m_iIndex;
m_wndCBrowserTab = aNewActiveTab;
//SendMessage(WM_SWITCHTAB, (WPARAM)m_wndCBrowserTab, (LPARAM)aNewActiveTab);
theApp.plugins.SendMessage("*", "*", "SwitchTab", (long)oldTab->GetSafeHwnd(), (long)aNewActiveTab->GetSafeHwnd());
//m_wndTabs->SelectItem(TABINDEXTOID(aNewActiveTab->m_iIndex));
@ -400,6 +403,7 @@ void CBrowserFrmTab::SetActiveBrowser(CBrowserTab* aNewActiveTab)
// BUG: We may be here because of a call to this function.
aNewActiveTab->SetActive(true, focus);
aNewActiveTab->GetBrowserWrapper()->SetVisible(true);
// Don't wait for MFC to update the tab bar
m_wndTabs->GetToolBarCtrl().CheckButton(TABINDEXTOID(aNewActiveTab->m_iIndex), 1);
// Remove a possible tooltip

@ -1168,6 +1168,11 @@ BOOL CBrowserWrapper::GetSelection(CString& aSelText)
return TRUE;
}
void CBrowserWrapper::SetVisible(BOOL aVisible)
{
GetDocShell()->SetIsActive(aVisible);
}
//#include "nsIWidgetListener.h"
void CBrowserWrapper::SetActive(BOOL aActive)
{
@ -1182,7 +1187,10 @@ void CBrowserWrapper::SetActive(BOOL aActive)
NS_ENSURE_TRUE(mWebBrowserFocus, );
TRACE2("Set Active Browser %u for window %s\n", aActive, (LPCTSTR)GetTitle());
if (aActive) mWebBrowserFocus->Activate(); else mWebBrowserFocus->Deactivate();
if (aActive)
mWebBrowserFocus->Activate();
else
mWebBrowserFocus->Deactivate();
}
BOOL CBrowserWrapper::GetCertificate(nsIX509Cert** certificate)

@ -280,6 +280,7 @@ public:
return NS_OK;
}
void SetVisible(BOOL aVisible);
void SetActive(BOOL aActive);
int GetSecurityState();

Loading…
Cancel
Save