diff --git a/src/common/appcmn.cpp b/src/common/appcmn.cpp index 49dfb98eed..608a40ea4e 100644 --- a/src/common/appcmn.cpp +++ b/src/common/appcmn.cpp @@ -141,7 +141,15 @@ void wxAppBase::ProcessPendingEvents() void wxAppBase::SetActive(bool active, wxWindow * WXUNUSED(lastFocus)) { + if ( active == m_isActive ) + return; + m_isActive = active; + + wxActivateEvent event(wxEVT_ACTIVATE_APP, active); + event.SetEventObject(this); + + (void)ProcessEvent(event); } #endif // wxUSE_GUI diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index 8f73c4e2db..9b8f1de926 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -2786,11 +2786,6 @@ void wxWindowGTK::OnInternalIdle() g_sendActivateEvent = -1; wxTheApp->SetActive(activate, (wxWindow *)g_focusWindowLast); - - wxActivateEvent event(wxEVT_ACTIVATE_APP, activate, GetId()); - event.SetEventObject(this); - - (void)GetEventHandler()->ProcessEvent(event); } wxCursor cursor = m_cursor; diff --git a/src/gtk1/window.cpp b/src/gtk1/window.cpp index 8f73c4e2db..9b8f1de926 100644 --- a/src/gtk1/window.cpp +++ b/src/gtk1/window.cpp @@ -2786,11 +2786,6 @@ void wxWindowGTK::OnInternalIdle() g_sendActivateEvent = -1; wxTheApp->SetActive(activate, (wxWindow *)g_focusWindowLast); - - wxActivateEvent event(wxEVT_ACTIVATE_APP, activate, GetId()); - event.SetEventObject(this); - - (void)GetEventHandler()->ProcessEvent(event); } wxCursor cursor = m_cursor;