? scintilla_caret_tick.patch
Index: gtk/ScintillaGTK.cxx
===================================================================
RCS file: /cvsroot/scintilla/scintilla/gtk/ScintillaGTK.cxx,v
retrieving revision 1.184
diff -a -u -r1.184 ScintillaGTK.cxx
--- gtk/ScintillaGTK.cxx	25 Feb 2008 00:01:51 -0000	1.184
+++ gtk/ScintillaGTK.cxx	3 Jun 2008 16:59:53 -0000
@@ -647,6 +647,7 @@
 #endif
 #endif
 
+	sciThis->SetTicking(true);
 	return FALSE;
 }
 
@@ -667,6 +668,7 @@
 #endif
 #endif
 
+	sciThis->SetTicking(false);
 	return FALSE;
 }
 
@@ -798,12 +800,15 @@
 		g_object_get(G_OBJECT(
 			gtk_settings_get_default()), "gtk-cursor-blink-time", &value, NULL);
 		caret.period = gint(value / 1.75);
+		timer.tickSize = caret.period;
 	} else {
 		caret.period = 0;
+		timer.tickSize = 100;
 	}
 #endif
 
-	SetTicking(true);
+	// initially don't tick, ticking is started once the window receives the focus
+	SetTicking(false);
 }
 
 void ScintillaGTK::Finalise() {
Index: src/Editor.cxx
===================================================================
RCS file: /cvsroot/scintilla/scintilla/src/Editor.cxx,v
retrieving revision 1.412
diff -a -u -r1.412 Editor.cxx
--- src/Editor.cxx	27 Apr 2008 07:49:54 -0000	1.412
+++ src/Editor.cxx	3 Jun 2008 17:00:01 -0000
@@ -5534,6 +5534,12 @@
 		// Auto scroll
 		ButtonMove(ptMouseLast);
 	}
+#ifdef PLAT_GTK
+	caret.on = !caret.on;
+	if (caret.active) {
+		InvalidateCaret();
+	}
+#else
 	if (caret.period > 0) {
 		timer.ticksToWait -= timer.tickSize;
 		if (timer.ticksToWait <= 0) {
@@ -5544,6 +5550,7 @@
 			}
 		}
 	}
+#endif
 	if (horizontalScrollBarVisible && trackLineWidth && (lineWidthMaxSeen > scrollWidth)) {
 		scrollWidth = lineWidthMaxSeen;
 		SetScrollBars();
Index: src/Editor.h
===================================================================
RCS file: /cvsroot/scintilla/scintilla/src/Editor.h,v
retrieving revision 1.135
diff -a -u -r1.135 Editor.h
--- src/Editor.h	30 Jan 2008 09:20:11 -0000	1.135
+++ src/Editor.h	3 Jun 2008 17:00:03 -0000
@@ -29,7 +29,7 @@
 public:
 	bool ticking;
 	int ticksToWait;
-	enum {tickSize = 100};
+	int tickSize;
 	TickerID tickerID;
 
 	Timer();
