diff --git a/src/kits/app/Roster.cpp b/src/kits/app/Roster.cpp index e6bd0622bf..f6b5ae1719 100644 --- a/src/kits/app/Roster.cpp +++ b/src/kits/app/Roster.cpp @@ -1736,7 +1736,8 @@ BRoster::_ApplicationCrashed(team_id team) /*! Tells the registrar which application is currently active. - It's called from within BWindow on B_WINDOW_ACTIVATED messages. + It's called from within the app_server when the active application is + changed. */ status_t BRoster::_UpdateActiveApp(team_id team) const diff --git a/src/kits/interface/Window.cpp b/src/kits/interface/Window.cpp index c3b7bba22e..0e0921f88b 100644 --- a/src/kits/interface/Window.cpp +++ b/src/kits/interface/Window.cpp @@ -29,7 +29,6 @@ #include #include #include -#include #include #include #include @@ -906,11 +905,6 @@ FrameMoved(origin); if (msg->FindBool("active", &active) == B_OK && active != fActive) { fActive = active; - if (active) { - // notify registrar about the active app - BRoster::Private roster; - roster.UpdateActiveApp(be_app->Team()); - } WindowActivated(active); diff --git a/src/servers/app/ServerApp.cpp b/src/servers/app/ServerApp.cpp index d454cbe7f4..fddaa83c2d 100644 --- a/src/servers/app/ServerApp.cpp +++ b/src/servers/app/ServerApp.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2006, Haiku. + * Copyright 2001-2007, Haiku. * Distributed under the terms of the MIT License. * * Authors: @@ -41,6 +41,12 @@ #include "SystemPalette.h" #include "WindowLayer.h" +#include +#include +#include +#include +#include + #include #include #include @@ -48,11 +54,6 @@ #include #include -#include -#include -#include -#include - #include #include #include @@ -298,6 +299,10 @@ ServerApp::Activate(bool value) fIsActive = value; if (fIsActive) { + // notify registrar about the active app + BRoster::Private roster; + roster.UpdateActiveApp(ClientTeam()); + if (_HasWindowUnderMouse()) { // Set the cursor to the application cursor, if any fDesktop->SetCursor(CurrentCursor()); diff --git a/src/servers/registrar/TRoster.cpp b/src/servers/registrar/TRoster.cpp index 1cc76608cc..b355631850 100644 --- a/src/servers/registrar/TRoster.cpp +++ b/src/servers/registrar/TRoster.cpp @@ -721,7 +721,8 @@ TRoster::HandleGetAppList(BMessage *request) /*! \brief Handles a _UpdateActiveApp() request. - This is sent from a BWindow when it receives a B_WINDOW_ACTIVATED message. + This is sent from the app_server when the current active application + is changed. \param request The request message */