1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-12-09 06:06:24 +01:00

Bug1432 partial, keep correct focus in more cases, not all...

Works by using the newer and better logic of ToolManager for remembering which
window to focus.

It seems, at least on Windows, that when the toolbar with the focused control
is docked after the end of a docking (of itself or another bar), then focus
remains.

If the bar with the focus is undocked and another bar docks or undocks, focus
is still lost.
This commit is contained in:
Paul Licameli
2017-07-23 14:33:16 -04:00
parent 9aea0d3967
commit 503f3548a1
4 changed files with 13 additions and 27 deletions

View File

@@ -1491,11 +1491,19 @@ void ToolManager::DoneDragging()
mDidDrag = false;
mClicked = false;
RestoreFocus();
}
bool ToolManager::RestoreFocus()
{
if (mLastFocus) {
auto temp1 = AButton::TemporarilyAllowFocus();
auto temp2 = ASlider::TemporarilyAllowFocus();
auto temp3 = Meter::TemporarilyAllowFocus();
auto parent = mLastFocus->GetParent();
mLastFocus->SetFocus();
return true;
}
return false;
}

View File

@@ -71,6 +71,8 @@ class ToolManager final : public wxEvtHandler, public wxEventFilter
int FilterEvent(wxEvent &event) override;
bool RestoreFocus();
private:
ToolBar *Float( ToolBar *t, wxPoint & pos );