[Monodevelop-patches-list] r1366 - in trunk/MonoDevelop/src/AddIns: BackendBindings/CSharpBinding/Gui DisplayBindings/SourceEditor DisplayBindings/SourceEditor/Gui

commit-watcher at mono-cvs.ximian.com commit-watcher at mono-cvs.ximian.com
Sun Apr 4 00:50:24 EST 2004


Author: tberman
Date: 2004-04-04 00:50:24 -0500 (Sun, 04 Apr 2004)
New Revision: 1366

Modified:
   trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/Gui/CodeGenerationPanel.cs
   trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/Gui/OutputOptionsPanel.cs
   trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/ChangeLog
   trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorDisplayBinding.cs
   trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorView.cs
Log:
attempt to solve that strange threading issue...

for some reason i think gtk+ hates me...


Modified: trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/Gui/CodeGenerationPanel.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/Gui/CodeGenerationPanel.cs	2004-04-04 05:07:24 UTC (rev 1365)
+++ trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/Gui/CodeGenerationPanel.cs	2004-04-04 05:50:24 UTC (rev 1366)
@@ -18,6 +18,7 @@
 
 using Gtk;
 using MonoDevelop.Gui.Widgets;
+using MonoDevelop.Services;
 
 namespace CSharpBinding
 {

Modified: trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/Gui/OutputOptionsPanel.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/Gui/OutputOptionsPanel.cs	2004-04-04 05:07:24 UTC (rev 1365)
+++ trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/Gui/OutputOptionsPanel.cs	2004-04-04 05:50:24 UTC (rev 1366)
@@ -16,6 +16,8 @@
 using MonoDevelop.Core.Properties;
 using MonoDevelop.Core.AddIns.Codons;
 
+using MonoDevelop.Services;
+
 using Gtk;
 using MonoDevelop.Gui.Widgets;
 

Modified: trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/ChangeLog
===================================================================
--- trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/ChangeLog	2004-04-04 05:07:24 UTC (rev 1365)
+++ trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/ChangeLog	2004-04-04 05:50:24 UTC (rev 1366)
@@ -1,5 +1,11 @@
 2004-04-03  Todd Berman  <tberman at sevenl.net>
 
+	* Gui/SourceEditorView.cs:
+	* Gui/SourceEditorDisplayBinding.cs: attempt to solve gtk+ threading
+	issues
+
+2004-04-03  Todd Berman  <tberman at sevenl.net>
+
 	* Gui/Dialogs/ReplaceInFilesDialog.cs:
 	* Gui/SourceEditorView.cs:
 	* Gui/Pads/CompilerMessageView.cs:

Modified: trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorDisplayBinding.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorDisplayBinding.cs	2004-04-04 05:07:24 UTC (rev 1365)
+++ trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorDisplayBinding.cs	2004-04-04 05:50:24 UTC (rev 1366)
@@ -221,10 +221,23 @@
 			get { return se.Buffer; }
 		}
 		
+		string cachedText;
 		public string Text {
-			get { return se.Buffer.Text; }
+			get {
+				GLib.Idle.Add (new GLib.IdleHandler (BounceAndGrab));
+				return cachedText;
+			}
 			set { se.Buffer.Text = value; }
 		}
+
+		bool needsUpdate;
+		bool BounceAndGrab ()
+		{
+			if (needsUpdate) {
+				cachedText = se.Buffer.Text;
+			}
+			return false;
+		}
 		
 		public void Undo ()
 		{
@@ -244,6 +257,7 @@
 		{
 			// 99% of the time, this is the insertion point
 			UpdateLineCol ();
+			needsUpdate = true;
 		}
 		
 		void OnChanged (object o, EventArgs e)
@@ -251,6 +265,7 @@
 			// gedit also hooks this event, but do we need it?
 			UpdateLineCol ();
 			OnContentChanged (null);
+			needsUpdate = true;
 		}
 		
 		// WORKAROUND until we get this method returning char in gtk#

Modified: trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorView.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorView.cs	2004-04-04 05:07:24 UTC (rev 1365)
+++ trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorView.cs	2004-04-04 05:50:24 UTC (rev 1366)
@@ -462,7 +462,7 @@
 		}
 		
 		string IFormattableDocument.TextContent
-		{ get { return Buffer.Text; } }
+		{ get { return ParentEditor.DisplayBinding.Text; } }
 		
 		int IFormattableDocument.TextLength
 		{ get { return Buffer.EndIter.Offset; } }




More information about the Monodevelop-patches-list mailing list