mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
Fixes focus not being set on gamelist after tab change
Once a tab is selected the focus can be set directly from the page changed event. However once the tab was shown, the first tab order control element was given the focus by default. This was fixed by delaying the action and setting the focus after the default focus had been assigned.
This commit is contained in:
@ -239,6 +239,9 @@ NetPlaySetupFrame::NetPlaySetupFrame(wxWindow* const parent, const CGameListCtrl
|
||||
|
||||
panel->SetSizerAndFit(main_szr);
|
||||
|
||||
// Handle focus on tab changes
|
||||
panel->Bind(wxEVT_NOTEBOOK_PAGE_CHANGED, &NetPlaySetupFrame::OnTabChanged, this);
|
||||
|
||||
// wxBoxSizer* const diag_szr = new wxBoxSizer(wxVERTICAL);
|
||||
// diag_szr->Add(panel, 1, wxEXPAND);
|
||||
// SetSizerAndFit(diag_szr);
|
||||
@ -529,6 +532,23 @@ void NetPlaySetupFrame::OnKeyDown(wxKeyEvent& event)
|
||||
}
|
||||
}
|
||||
|
||||
void NetPlaySetupFrame::OnTabChanged(wxCommandEvent& event)
|
||||
{
|
||||
// Propagate event
|
||||
event.Skip();
|
||||
|
||||
// Delaying action so the first tab order element doesn't override the focus
|
||||
m_notebook->Bind(wxEVT_IDLE, &NetPlaySetupFrame::OnAfterTabChange, this);
|
||||
}
|
||||
|
||||
void NetPlaySetupFrame::OnAfterTabChange(wxIdleEvent&)
|
||||
{
|
||||
// Unbinding so we don't hog the idle event
|
||||
m_notebook->Unbind(wxEVT_IDLE, &NetPlaySetupFrame::OnAfterTabChange, this);
|
||||
|
||||
DispatchFocus();
|
||||
}
|
||||
|
||||
void NetPlaySetupFrame::DispatchFocus()
|
||||
{
|
||||
int current_tab = m_notebook->GetSelection();
|
||||
|
Reference in New Issue
Block a user