diff options
| author | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2018-02-20 14:17:56 +0100 |
|---|---|---|
| committer | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2018-02-20 14:22:24 +0100 |
| commit | d8367a33368e783c15f2072daa9237b2643526d3 (patch) | |
| tree | b770c2b8d3d6f0b6f6f69676f0e42194af2c053a /src/GraphicObjects/GraphicObject.cs | |
| parent | 0ce668c6c13521ebfcb9ed02365556a31a65b6b2 (diff) | |
debug threading with new TemplatedGroup arch, review examples.singleLeveledTemplatedGroup
Diffstat (limited to 'src/GraphicObjects/GraphicObject.cs')
| -rw-r--r-- | src/GraphicObjects/GraphicObject.cs | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/src/GraphicObjects/GraphicObject.cs b/src/GraphicObjects/GraphicObject.cs index 9857d198..d49cbe8f 100644 --- a/src/GraphicObjects/GraphicObject.cs +++ b/src/GraphicObjects/GraphicObject.cs @@ -243,10 +243,11 @@ namespace Crow if (parent == value) return; DataSourceChangeEventArgs e = new DataSourceChangeEventArgs (parent, value); - lock (this) + lock (CurrentInterface.LayoutMutex) { parent = value; - - onParentChanged (this, e); + } + onParentChanged (this, e); + } } [XmlIgnore]public ILayoutable LogicalParent { @@ -786,8 +787,9 @@ namespace Crow //prevent setting null causing stack overflow in specific case if (dse.NewDataSource == dse.OldDataSource) return; - - OnDataSourceChanged (this, dse); + lock (CurrentInterface.LayoutMutex) { + OnDataSourceChanged (this, dse); + } NotifyValueChanged ("DataSource", DataSource); } @@ -1097,7 +1099,7 @@ namespace Crow /// fired when drag and drop operation start /// </summary> protected virtual void onStartDrag (object sender, DragDropEventArgs e){ - CurrentInterface.HoverWidget = this.focusParent; + CurrentInterface.HoverWidget = null; IsDragged = true; StartDrag.Raise (this, e); Debug.WriteLine(this.ToString() + " : START DRAG => " + e.ToString()); @@ -1136,11 +1138,13 @@ namespace Crow #if DEBUG_UPDATE Debug.WriteLine (string.Format("ClippingRegistration -> {0}", this.ToString ())); #endif - IsQueueForRedraw = false; - if (Parent == null) - return; - Parent.RegisterClip (LastPaintedSlot); - Parent.RegisterClip (Slot); + lock(CurrentInterface.LayoutMutex){ + IsQueueForRedraw = false; + if (Parent == null) + return; + Parent.RegisterClip (LastPaintedSlot); + Parent.RegisterClip (Slot); + } } /// <summary> /// Add clip rectangle to this.clipping and propagate up to root |