summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinWX/NetWindow.cpp
diff options
context:
space:
mode:
authorRachel Bryk <RachelBryk@gmail.com>2014-05-23 02:20:22 -0400
committerRachel Bryk <RachelBryk@gmail.com>2014-05-23 07:30:08 -0400
commitcd299f0703460ffe9dde6e154bcf876eb895876c (patch)
tree4553c7ba5fc58c3ea21cfecc9eba03761d65c61c /Source/Core/DolphinWX/NetWindow.cpp
parentb58753bd692d0634e950af9b273bbfb24564d0dd (diff)
Flash netplay window when someone joins if the window doesn't have focus.
Diffstat (limited to 'Source/Core/DolphinWX/NetWindow.cpp')
-rw-r--r--Source/Core/DolphinWX/NetWindow.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/Source/Core/DolphinWX/NetWindow.cpp b/Source/Core/DolphinWX/NetWindow.cpp
index bb7044e313..514c51ae03 100644
--- a/Source/Core/DolphinWX/NetWindow.cpp
+++ b/Source/Core/DolphinWX/NetWindow.cpp
@@ -545,6 +545,17 @@ void NetPlayDiag::OnThread(wxCommandEvent& event)
m_player_lbox->SetSelection(selection);
+ // 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 :