Browse Source

Fixes for rare AvalonDock bugs:

- Exception when closing tab by middle-clicking
 - Exception when hovering over auto-hide pad
pull/6/merge
David Srbecký 13 years ago
parent
commit
954b991caf
  1. 9
      src/Libraries/AvalonDock/AvalonDock/DockingManager.cs
  2. 8
      src/Libraries/AvalonDock/AvalonDock/DocumentTabPanel.cs

9
src/Libraries/AvalonDock/AvalonDock/DockingManager.cs

@ -2637,6 +2637,15 @@ namespace AvalonDock @@ -2637,6 +2637,15 @@ namespace AvalonDock
return;
}
// David: This sometimes seems to be null when hovering over auto-hide pad.
// It only seems to occur in specific circumstances - whether the pad is the
// "selected" one in the set seems important. Having no open document might have effect?
// I have only managed to reliablely reproduce it in stand-alone application.
if (content.ContainerPane == null)
{
return;
}
//hide previous window
HideFlyoutWindow();

8
src/Libraries/AvalonDock/AvalonDock/DocumentTabPanel.cs

@ -65,6 +65,10 @@ namespace AvalonDock @@ -65,6 +65,10 @@ namespace AvalonDock
foreach (ManagedContent child in Children)
{
// David: Sometimes happened when closing document tab by middle clicking. Really difficult to reproduce.
if (child == null)
continue;
Panel.SetZIndex(child, Selector.GetIsSelected(child) ? 1 : -i);
i++;
child.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity));
@ -81,6 +85,10 @@ namespace AvalonDock @@ -81,6 +85,10 @@ namespace AvalonDock
bool skipAllOthers = false;
foreach (ManagedContent doc in Children)
{
// David: Sometimes happened when closing document tab by middle clicking. Really difficult to reproduce.
if (doc == null)
continue;
if (skipAllOthers || offset + doc.DesiredSize.Width > finalSize.Width)
{
SetIsHeaderVisible(doc, false);

Loading…
Cancel
Save