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:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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 );
|
||||
|
||||
Reference in New Issue
Block a user