From f81a758d4e48d677720b188c53d2988c5ef8616d Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 5 Jun 2014 00:26:27 +0000 Subject: [PATCH] Stop Scintilla timer when the control doesn't have focus. This avoids excessive CPU load due to generating completely unnecessary timer notifications for every wxSTC control in a program. Closes #14938. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76665 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/stc/ScintillaWX.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/stc/ScintillaWX.cpp b/src/stc/ScintillaWX.cpp index c80c7740e0..dc3512ee25 100644 --- a/src/stc/ScintillaWX.cpp +++ b/src/stc/ScintillaWX.cpp @@ -941,6 +941,7 @@ void ScintillaWX::DoLoseFocus(){ SetFocusState(false); focusEvent = false; DestroySystemCaret(); + SetTicking(false); } void ScintillaWX::DoGainFocus(){ @@ -949,6 +950,7 @@ void ScintillaWX::DoGainFocus(){ focusEvent = false; DestroySystemCaret(); CreateSystemCaret(); + SetTicking(true); } void ScintillaWX::DoSysColourChange() {