From 3c7dc5d3c12e3ff353c54d407a8e6eb8d4d08d14 Mon Sep 17 00:00:00 2001 From: Charlie Fenton Date: Fri, 14 Feb 2014 02:50:46 -0800 Subject: [PATCH] MGR: Possible fix for excess CPU usage when Manager window is closed / hidden - I think this is safe, but it needs testing to ensure it has no adverse side effects --- clientgui/MainDocument.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/clientgui/MainDocument.cpp b/clientgui/MainDocument.cpp index 022099cb3f..fe14a8765f 100644 --- a/clientgui/MainDocument.cpp +++ b/clientgui/MainDocument.cpp @@ -997,6 +997,14 @@ void CMainDocument::RunPeriodicRPCs(int frameRefreshRate) { request.arg1 = &m_iNoticeSequenceNumber; request.arg2 = ¬ices; request.rpcType = RPC_TYPE_ASYNC_WITH_REFRESH_AFTER; + if (!pFrame->IsShown() +#ifdef __WXMAC__ + || (!wxGetApp().IsApplicationVisible()) +#endif + ) { + request.rpcType = RPC_TYPE_ASYNC_NO_REFRESH; + } + request.completionTime = &m_dtNoticesTimeStamp; request.resultPtr = &m_iGet_notices_rpc_result;