diff --git a/source/Components/AvalonDock/Controls/LayoutAnchorableFloatingWindowControl.cs b/source/Components/AvalonDock/Controls/LayoutAnchorableFloatingWindowControl.cs
index bf776e49..fb4d5ea6 100644
--- a/source/Components/AvalonDock/Controls/LayoutAnchorableFloatingWindowControl.cs
+++ b/source/Components/AvalonDock/Controls/LayoutAnchorableFloatingWindowControl.cs
@@ -226,14 +226,17 @@ protected override IntPtr FilterMessage(IntPtr hwnd, int msg, IntPtr wParam, Int
switch (msg)
{
case Win32Helper.WM_ACTIVATE:
- var isInactive = ((int)wParam & 0xFFFF) == Win32Helper.WA_INACTIVE;
- if (_model.IsSinglePane)
- {
- LayoutFloatingWindowControlHelper.ActiveTheContentOfSinglePane(this, !isInactive);
- }
- else
- {
- LayoutFloatingWindowControlHelper.ActiveTheContentOfMultiPane(this, !isInactive);
+ var isActive = ((int)wParam & 0xFFFF) != Win32Helper.WA_INACTIVE;
+ if (isActive)
+ {
+ if (_model.IsSinglePane)
+ {
+ LayoutFloatingWindowControlHelper.ActiveTheContentOfSinglePane(this);
+ }
+ else
+ {
+ LayoutFloatingWindowControlHelper.ActiveTheContentOfMultiPane(this);
+ }
}
handled = true;
diff --git a/source/Components/AvalonDock/Controls/LayoutDocumentFloatingWindowControl.cs b/source/Components/AvalonDock/Controls/LayoutDocumentFloatingWindowControl.cs
index 9072da87..ba175e6f 100644
--- a/source/Components/AvalonDock/Controls/LayoutDocumentFloatingWindowControl.cs
+++ b/source/Components/AvalonDock/Controls/LayoutDocumentFloatingWindowControl.cs
@@ -107,14 +107,17 @@ protected override IntPtr FilterMessage(IntPtr hwnd, int msg, IntPtr wParam, Int
switch (msg)
{
case Win32Helper.WM_ACTIVATE:
- var isInactive = ((int)wParam & 0xFFFF) == Win32Helper.WA_INACTIVE;
- if (_model.IsSinglePane)
+ var isActive = ((int)wParam & 0xFFFF) != Win32Helper.WA_INACTIVE;
+ if (isActive)
{
- LayoutFloatingWindowControlHelper.ActiveTheContentOfSinglePane(this, !isInactive);
- }
- else
- {
- LayoutFloatingWindowControlHelper.ActiveTheContentOfMultiPane(this, !isInactive);
+ if (_model.IsSinglePane)
+ {
+ LayoutFloatingWindowControlHelper.ActiveTheContentOfSinglePane(this, true);
+ }
+ else
+ {
+ LayoutFloatingWindowControlHelper.ActiveTheContentOfMultiPane(this, true);
+ }
}
handled = true;
@@ -419,4 +422,4 @@ private void OnExecuteCloseWindowCommand(object parameter)
}
}
}
-}
\ No newline at end of file
+}
diff --git a/source/TestApp/MainWindow.xaml b/source/TestApp/MainWindow.xaml
index 9fc89202..4dfcca60 100644
--- a/source/TestApp/MainWindow.xaml
+++ b/source/TestApp/MainWindow.xaml
@@ -115,6 +115,13 @@
Foreground="White"
Text="{Binding TestTimer, Mode=OneWay, StringFormat='Document 2 Attached to Timer ->\{0\}'}" />
+
+
+
diff --git a/source/TestApp/MainWindow.xaml.cs b/source/TestApp/MainWindow.xaml.cs
index 5d80ab83..71ad291b 100644
--- a/source/TestApp/MainWindow.xaml.cs
+++ b/source/TestApp/MainWindow.xaml.cs
@@ -256,5 +256,7 @@ private void OnNewFloatingWindow(object sender, RoutedEventArgs e)
anchorable.AddToLayout(dockManager,AnchorableShowStrategy.Most);
anchorable.Float();
}
+
+ private void ShowMessageBox_click(object sender, RoutedEventArgs e) => MessageBox.Show("Test messge", "Test");
}
}