diff options
author | Greg Munn <gregm@microsoft.com> | 2019-11-14 19:42:31 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-14 19:42:31 +0300 |
commit | 0ada7904fce8c6b87b8a85443b50ab62d0cda3ab (patch) | |
tree | 99c8d89b441ac968d382bcbb56d96d3127a8affc /main | |
parent | 1fc745240bbcbfeae9530a954cb45650daf77fcb (diff) | |
parent | 711ea2c65109335c09b2938c8fe974f54fb359f5 (diff) |
Merge pull request #9295 from mono/backport-pr-9290-to-release-8.4
[release-8.4] [Debugger] Add more Begin/End Updates around tree manipulation
Diffstat (limited to 'main')
4 files changed, 24 insertions, 8 deletions
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/LocalsPad.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/LocalsPad.cs index f979b5c29c..00e893bf9e 100644 --- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/LocalsPad.cs +++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/LocalsPad.cs @@ -77,9 +77,13 @@ namespace MonoDevelop.Debugger DebuggerLoggingService.LogMessage ("End Local Variables"); if (UseNewTreeView) { - controller.ClearValues (); - controller.AddValues (locals); - + _treeview.BeginUpdates (); + try { + controller.ClearValues (); + controller.AddValues (locals); + } finally { + _treeview.EndUpdates (); + } #if ADD_FAKE_NODES AddFakeNodes (); #endif diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValue/Mac/MacObjectValueTreeViewDataSource.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValue/Mac/MacObjectValueTreeViewDataSource.cs index a7e57261df..e257c352c5 100644 --- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValue/Mac/MacObjectValueTreeViewDataSource.cs +++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValue/Mac/MacObjectValueTreeViewDataSource.cs @@ -255,10 +255,14 @@ namespace MonoDevelop.Debugger var range = new NSRange (0, count); var indexes = NSIndexSet.FromNSRange (range); + treeView.BeginUpdates (); + treeView.RemoveItems (indexes, null, NSTableViewAnimation.None); for (int i = 0; i < removed.Count; i++) removed[i].Dispose (); + + treeView.EndUpdates (); } public void Append (ObjectValueNode node) diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValuePad.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValuePad.cs index cf4d3887cc..55c552ca64 100644 --- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValuePad.cs +++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValuePad.cs @@ -44,6 +44,8 @@ namespace MonoDevelop.Debugger protected ObjectValueTreeViewController controller; protected ObjectValueTreeView tree; + // this is for the new treeview + protected MacObjectValueTreeView _treeview; readonly Control control; PadFontChanger fontChanger; @@ -69,6 +71,7 @@ namespace MonoDevelop.Debugger if (Platform.IsMac) { LoggingService.LogInfo ("Using MacObjectValueTreeView for {0}", allowWatchExpressions ? "Watch Pad" : "Locals Pad"); var treeView = controller.GetMacControl (); + _treeview = treeView; fontChanger = new PadFontChanger (treeView, treeView.SetCustomFont, treeView.QueueResize); diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/WatchPad.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/WatchPad.cs index b16fb01d1a..37df2d4af9 100644 --- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/WatchPad.cs +++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/WatchPad.cs @@ -89,11 +89,16 @@ namespace MonoDevelop.Debugger controller.ExpressionAdded -= OnExpressionAdded; try { - // remove the expressions because we're going to rebuild them - controller.ClearAll (); - - // re-add the expressions which will reevaluate the expressions and repopulate the treeview - controller.AddExpressions (expressions); + _treeview.BeginUpdates (); + try { + // remove the expressions because we're going to rebuild them + controller.ClearAll (); + + // re-add the expressions which will reevaluate the expressions and repopulate the treeview + controller.AddExpressions (expressions); + } finally { + _treeview.EndUpdates (); + } } finally { controller.ExpressionAdded += OnExpressionAdded; } |