Undocked document is no longer the active ViewContent, if its window loses the focus #229
Description
SD-1902, originally created on 5/12/2012 17:08:30 by Siegfried Pammer
see
http://community.sharpdevelop.net/forums/t/15780.aspx
we have multiple opened view contents. One of them is dragged out and
floating. Now press Ctrl+Shift+F and the Search and Replace dialog pops
up.
Immediately the floating window loses the focus and a different docked
view content is marked active (= bold filename). Now searching in the
"active" floating view content (with "current document" setting) is no
longer possible.
This happens with any shortcut that opens a new dialog. If the window
loses the focus, it should not lose the "active document" status.
see FloatingWindow.cs, line 327
#region Active Content Management
ManagedContent lastActiveContent = null;
protected override void OnActivated(EventArgs e)
{
if (Manager != null)
{
lastActiveContent = Manager.ActiveContent;
Manager.ActiveContent = HostedPane.SelectedItem as
ManagedContent;
}
base.OnActivated(e);
}
protected override void OnDeactivated(EventArgs e)
{
if (Manager != null && lastActiveContent != null)
{
Manager.ActiveContent = lastActiveContent; //
commenting out this lines solves the issue,
// but I am not sure, if it has unwanted side-effects.
}
base.OnDeactivated(e);
}
#endregion