Removed "Active" stuff from Workspaces state.

As a side effect, the desktop is now clickable again.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15173 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2005-11-26 20:22:30 +00:00
parent 59e89c6052
commit 485b948731
5 changed files with 15 additions and 24 deletions

View File

@ -704,18 +704,17 @@ RootLayer::RevealNewWMState(Workspace::State &oldWMState)
// clear fWMState
fWMState.Focus = NULL;
fWMState.Front = NULL;
fWMState.Active = NULL;
fWMState.WindowList.MakeEmpty();
ActiveWorkspace()->GetState(&fWMState);
// send window activation messages
if (oldWMState.Active != fWMState.Active) {
if (oldWMState.Active)
oldWMState.Active->Activated(false);
if (fWMState.Active) {
fWMState.Active->Activated(true);
fDesktop->EventDispatcher().SetFocus(&fWMState.Active->Window()->FocusMessenger());
if (oldWMState.Focus != fWMState.Focus) {
if (oldWMState.Focus)
oldWMState.Focus->Activated(false);
if (fWMState.Focus) {
fWMState.Focus->Activated(true);
fDesktop->EventDispatcher().SetFocus(&fWMState.Focus->Window()->FocusMessenger());
} else
fDesktop->EventDispatcher().SetFocus(NULL);
}

View File

@ -70,7 +70,7 @@ public:
// TODO: we need to replace Winborder* with Layer*
inline WindowLayer* Focus() const { return fWMState.Focus; }
inline WindowLayer* Front() const { return fWMState.Front; }
inline WindowLayer* Active() const { return fWMState.Active; }
inline WindowLayer* Active() const { return fWMState.Focus; }
bool SetActive(WindowLayer* newActive, bool activate = true);
inline void SetWorkspaceCount(int32 wksCount);

View File

@ -456,7 +456,7 @@ WindowLayer::MouseDown(BMessage *msg, BPoint where)
}
} else if (target != NULL) {
// clicking a simple Layer.
if (GetRootLayer()->ActiveWorkspace()->Active() != this) {
if (GetRootLayer()->ActiveWorkspace()->Focus() != this) {
DesktopSettings desktopSettings(GetRootLayer()->GetDesktop());
// not in FFM mode?

View File

@ -96,7 +96,6 @@ Workspace::State::PrintToStream()
{
printf("WS::State - Front: %s\n", Front? Front->Name(): "NULL");
printf("WS::State - Focus: %s\n", Focus? Focus->Name(): "NULL");
printf("WS::State - Active: %s\n", Active? Active->Name(): "NULL");
for (int32 i = 0; i < WindowList.CountItems(); ++i) {
Layer *l = (Layer*)WindowList.ItemAt(i);
@ -215,33 +214,24 @@ Workspace::Front() const
WindowLayer *
Workspace::Active() const
{
// in case of a normal or modal window
if (fFrontItem && fFrontItem == fFocusItem)
return fFrontItem->layerPtr;
// a floating window is considered active if it has focus.
if (fFocusItem && (fFocusItem->layerPtr->Level() == B_FLOATING_APP ||
fFocusItem->layerPtr->Level() == B_FLOATING_ALL))
return fFocusItem->layerPtr;
return NULL;
return fFocusItem ? fFocusItem->layerPtr : NULL;
}
/*!
\brief Method that returns the state of window manager.
\param state - a pointer to a valid Workspace::State structure
\return void
Fills the state structure with the most important window manager attibutes:
front window, focus window, active window and the list of windows starting from
the backmost one at position 0 and ending with the most visible window.
front window, focus window, active window and the list of windows starting from
the backmost one at position 0 and ending with the most visible window.
*/
void
Workspace::GetState(Workspace::State *state) const
{
state->Front = Front();
state->Focus = Focus();
state->Active = Active();
ListData *cursor = fTopItem;
while (cursor) {
@ -250,12 +240,15 @@ Workspace::GetState(Workspace::State *state) const
cursor = cursor->lowerItem;
}
}
bool
Workspace::AttemptToSetFront(WindowLayer *newFront)
{
return MoveToFront(newFront);
}
int32
Workspace::AttemptToSetFocus(WindowLayer *newFocus)
{

View File

@ -57,7 +57,6 @@ class Workspace {
WindowLayer* Front;
WindowLayer* Focus;
WindowLayer* Active;
BList WindowList;
};
Workspace( const int32 ID,