From ab0284a73579801d0ec0ad2c0306a2ab245e30dc Mon Sep 17 00:00:00 2001 From: Charlie Fenton Date: Tue, 30 Aug 2005 11:34:27 +0000 Subject: [PATCH] *** empty log message *** svn path=/trunk/boinc/; revision=7607 --- checkin_notes | 9 +++++++++ clientgui/MainFrame.cpp | 9 ++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/checkin_notes b/checkin_notes index 5044349ae7..a8eebc47e1 100755 --- a/checkin_notes +++ b/checkin_notes @@ -11171,3 +11171,12 @@ Janus 30 Aug 2005 user/ view_profile.php +Charlie 30 Aug 2005 + - Fix excessive CPU usage on Mac when Manager window was open. + CMainFrame::OnFrameRender() was always calling SetTitle(), which + forced a full redraw of the window once every second. The full + redraw is very CPU-intensive. We now call GetTitle() and don't + call SetTile() unless title text has changed. + + clientgui/ + MainFrame.cpp diff --git a/clientgui/MainFrame.cpp b/clientgui/MainFrame.cpp index 94a1f12b5a..68ff4eb64a 100644 --- a/clientgui/MainFrame.cpp +++ b/clientgui/MainFrame.cpp @@ -1665,9 +1665,11 @@ void CMainFrame::OnFrameRender(wxTimerEvent &event) { strStatusText.Printf(_("Connected to %s"), strComputerName.c_str()); } - SetTitle(strTitle); - // The Mac takes a huge performance hit changing the text of a floating + // The Mac takes a huge performance hit redrawing this window, // window, so don't change the text unless we really have too. + if (GetTitle() != strTitle) + SetTitle(strTitle); + if (strStatusText != strCachedStatusText) { strCachedStatusText = strStatusText; m_pStatusbar->m_ptxtConnected->SetLabel(strStatusText); @@ -1678,7 +1680,8 @@ void CMainFrame::OnFrameRender(wxTimerEvent &event) { m_pStatusbar->m_pbmpDisconnect->Show(); m_pStatusbar->m_ptxtDisconnect->Show(); - SetTitle(m_strBaseTitle); + if (GetTitle() != m_strBaseTitle) + SetTitle(m_strBaseTitle); } } }