Merge pull request #391 from RachelBryk/netplay-flash-on-join

Flash netplay window when someone joins if the window doesn't have focus...
This commit is contained in:
Ryan Houdek 2014-06-07 06:33:54 -05:00
commit 103d9008d6
1 changed files with 11 additions and 0 deletions

View File

@ -563,6 +563,17 @@ void NetPlayDiag::OnThread(wxCommandEvent& event)
}
}
// flash window in taskbar when someone joins if window isn't active
static u8 numPlayers = 1;
bool focus = (wxWindow::FindFocus() == this || (wxWindow::FindFocus() != nullptr && wxWindow::FindFocus()->GetParent() == this) ||
(wxWindow::FindFocus() != nullptr && wxWindow::FindFocus()->GetParent() != nullptr
&& wxWindow::FindFocus()->GetParent()->GetParent() == this));
if (netplay_server != nullptr && numPlayers < m_playerids.size() && !focus)
{
RequestUserAttention();
}
numPlayers = m_playerids.size();
switch (event.GetId())
{
case NP_GUI_EVT_CHANGE_GAME :