Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: ollydbg on November 25, 2014, 02:17:59 am

Title: Please help to review the patch to fix the caret blinking issue (#92)
Post by: ollydbg on November 25, 2014, 02:17:59 am
Hi, I have a patch to fix the Ticket #92 cursor blinking speed (https://sourceforge.net/p/codeblocks/tickets/92/)
Please help the review the code (I don't know how to add comments like /* C::B begin */ and /* C::B end */, since I remove some code, I just comment out the code with the C::B style comment wrapped.

Code
 src/sdk/wxscintilla/src/ScintillaWX.cpp | 20 ++++++++++++++++----
 src/sdk/wxscintilla/src/ScintillaWX.h   |  4 +++-
 2 files changed, 19 insertions(+), 5 deletions(-)

diff --git a/src/sdk/wxscintilla/src/ScintillaWX.cpp b/src/sdk/wxscintilla/src/ScintillaWX.cpp
index da1538c..96ed629 100644
--- a/src/sdk/wxscintilla/src/ScintillaWX.cpp
+++ b/src/sdk/wxscintilla/src/ScintillaWX.cpp
@@ -343,7 +343,10 @@ void ScintillaWX::Initialise() {
 
 void ScintillaWX::Finalise() {
     ScintillaBase::Finalise();
-    SetTicking(false);
+/* C::B begin */
+// SetTicking function is deprecated since we implement fine grained timers
+//    SetTicking(false);
+/* C::B end */
     SetIdle(false);
     DestroySystemCaret();
 }
@@ -405,7 +408,9 @@ bool ScintillaWX::SetIdle(bool on) {
     return idler.state;
 }
 
-
+/* C::B begin */
+#if 0 // SetTicking function get deprecated
+/* C::B end */
 void ScintillaWX::SetTicking(bool on) {
     wxSCITimer* sciTimer;
     if (timer.ticking != on) {
@@ -423,6 +428,9 @@ void ScintillaWX::SetTicking(bool on) {
     }
     timer.ticksToWait = caret.period;
 }
+/* C::B begin */
+#endif
+/* C::B end */
 
 
 void ScintillaWX::SetMouseCapture(bool on) {
@@ -1127,7 +1135,9 @@ void ScintillaWX::DoLoseFocus(){
     SetMouseCapture(false);
 /* C::B end */
     DestroySystemCaret();
-    SetTicking(false);
+/* C::B begin */
+    //SetTicking(false);
+/* C::B end */
 }
 
 void ScintillaWX::DoGainFocus(){
@@ -1136,7 +1146,9 @@ void ScintillaWX::DoGainFocus(){
     focusEvent = false;
     DestroySystemCaret();
     CreateSystemCaret();
-    SetTicking(true);
+/* C::B begin */
+    //SetTicking(true);
+/* C::B end */
 }
 
 void ScintillaWX::DoSysColourChange() {
diff --git a/src/sdk/wxscintilla/src/ScintillaWX.h b/src/sdk/wxscintilla/src/ScintillaWX.h
index 2e02405..96de9d2 100644
--- a/src/sdk/wxscintilla/src/ScintillaWX.h
+++ b/src/sdk/wxscintilla/src/ScintillaWX.h
@@ -119,7 +119,9 @@ public:
     virtual void Finalise();
     virtual void StartDrag();
     virtual bool SetIdle(bool on);
-    virtual void SetTicking(bool on);
+/* C::B begin */
+    //virtual void SetTicking(bool on);
+/* C::B end */
     virtual void SetMouseCapture(bool on);
     virtual bool HaveMouseCapture();
     virtual void ScrollText(int linesToMove);


Thanks.

Title: Re: Please help to review the patch to fix the caret blinking issue (#92)
Post by: ollydbg on November 29, 2014, 03:30:49 pm
In trunk now, feel free to adjust.  ;)