Introduced Layer::Activated() hook function. Moved some functionality from RootLayer to WinBorder

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14565 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Adi Oanca 2005-10-29 11:15:47 +00:00
parent a577cf141f
commit 31ec092be1
5 changed files with 20 additions and 10 deletions

View File

@ -1194,6 +1194,12 @@ Layer::WorkspacesChanged(uint32 oldWorkspaces, uint32 newWorkspaces)
// Empty // Empty
} }
void
Layer::Activated(bool active)
{
// Empty
}
// BoundsOrigin // BoundsOrigin
BPoint BPoint
Layer::BoundsOrigin() const Layer::BoundsOrigin() const

View File

@ -171,6 +171,7 @@ class Layer {
virtual void WorkspaceActivated(int32 index, bool active); virtual void WorkspaceActivated(int32 index, bool active);
virtual void WorkspacesChanged(uint32 oldWorkspaces, uint32 newWorkspaces); virtual void WorkspacesChanged(uint32 oldWorkspaces, uint32 newWorkspaces);
virtual void Activated(bool active);
BPoint BoundsOrigin() const; // BoundsFrameDiff()? BPoint BoundsOrigin() const; // BoundsFrameDiff()?
float Scale() const; float Scale() const;

View File

@ -828,16 +828,10 @@ RootLayer::RevealNewWMState(Workspace::State &oldWMState)
// floating window having focus. // floating window having focus.
// send window activation messages // send window activation messages
if (oldWMState.Active != fWMState.Active) { if (oldWMState.Active != fWMState.Active) {
if (oldWMState.Active && oldWMState.Active->Window()) { if (oldWMState.Active)
BMessage msg(B_WINDOW_ACTIVATED); oldWMState.Active->Activated(false);
msg.AddBool("active", false); if (fWMState.Active)
oldWMState.Active->Window()->SendMessageToClient(&msg, B_NULL_TOKEN, false); fWMState.Active->Activated(true);
}
if (fWMState.Active && fWMState.Active->Window()) {
BMessage msg(B_WINDOW_ACTIVATED);
msg.AddBool("active", true);
fWMState.Active->Window()->SendMessageToClient(&msg, B_NULL_TOKEN, false);
}
} }
// calculate the region that must be invalidated/redrawn // calculate the region that must be invalidated/redrawn

View File

@ -655,6 +655,14 @@ WinBorder::WorkspacesChanged(uint32 oldWorkspaces, uint32 newWorkspaces)
Window()->SendMessageToClient(&changedMsg, B_NULL_TOKEN, false); Window()->SendMessageToClient(&changedMsg, B_NULL_TOKEN, false);
} }
void
WinBorder::Activated(bool active)
{
BMessage msg(B_WINDOW_ACTIVATED);
msg.AddBool("active", false);
Window()->SendMessageToClient(&msg, B_NULL_TOKEN, false);
}
// SetTabLocation // SetTabLocation
void void
WinBorder::SetTabLocation(float location) WinBorder::SetTabLocation(float location)

View File

@ -90,6 +90,7 @@ class WinBorder : public Layer {
virtual void WorkspaceActivated(int32 index, bool active); virtual void WorkspaceActivated(int32 index, bool active);
virtual void WorkspacesChanged(uint32 oldWorkspaces, uint32 newWorkspaces); virtual void WorkspacesChanged(uint32 oldWorkspaces, uint32 newWorkspaces);
virtual void Activated(bool active);
void UpdateColors(); void UpdateColors();
void UpdateDecorator(); void UpdateDecorator();