Skip to content
This repository was archived by the owner on Oct 16, 2020. It is now read-only.
This repository was archived by the owner on Oct 16, 2020. It is now read-only.

Undocked document is no longer the active ViewContent, if its window loses the focus #229

Open
@dgrunwald

Description

@dgrunwald

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions