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:
@@ -704,18 +704,17 @@ RootLayer::RevealNewWMState(Workspace::State &oldWMState)
|
|||||||
// clear fWMState
|
// clear fWMState
|
||||||
fWMState.Focus = NULL;
|
fWMState.Focus = NULL;
|
||||||
fWMState.Front = NULL;
|
fWMState.Front = NULL;
|
||||||
fWMState.Active = NULL;
|
|
||||||
fWMState.WindowList.MakeEmpty();
|
fWMState.WindowList.MakeEmpty();
|
||||||
|
|
||||||
ActiveWorkspace()->GetState(&fWMState);
|
ActiveWorkspace()->GetState(&fWMState);
|
||||||
|
|
||||||
// send window activation messages
|
// send window activation messages
|
||||||
if (oldWMState.Active != fWMState.Active) {
|
if (oldWMState.Focus != fWMState.Focus) {
|
||||||
if (oldWMState.Active)
|
if (oldWMState.Focus)
|
||||||
oldWMState.Active->Activated(false);
|
oldWMState.Focus->Activated(false);
|
||||||
if (fWMState.Active) {
|
if (fWMState.Focus) {
|
||||||
fWMState.Active->Activated(true);
|
fWMState.Focus->Activated(true);
|
||||||
fDesktop->EventDispatcher().SetFocus(&fWMState.Active->Window()->FocusMessenger());
|
fDesktop->EventDispatcher().SetFocus(&fWMState.Focus->Window()->FocusMessenger());
|
||||||
} else
|
} else
|
||||||
fDesktop->EventDispatcher().SetFocus(NULL);
|
fDesktop->EventDispatcher().SetFocus(NULL);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ public:
|
|||||||
// TODO: we need to replace Winborder* with Layer*
|
// TODO: we need to replace Winborder* with Layer*
|
||||||
inline WindowLayer* Focus() const { return fWMState.Focus; }
|
inline WindowLayer* Focus() const { return fWMState.Focus; }
|
||||||
inline WindowLayer* Front() const { return fWMState.Front; }
|
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);
|
bool SetActive(WindowLayer* newActive, bool activate = true);
|
||||||
|
|
||||||
inline void SetWorkspaceCount(int32 wksCount);
|
inline void SetWorkspaceCount(int32 wksCount);
|
||||||
|
|||||||
@@ -456,7 +456,7 @@ WindowLayer::MouseDown(BMessage *msg, BPoint where)
|
|||||||
}
|
}
|
||||||
} else if (target != NULL) {
|
} else if (target != NULL) {
|
||||||
// clicking a simple Layer.
|
// clicking a simple Layer.
|
||||||
if (GetRootLayer()->ActiveWorkspace()->Active() != this) {
|
if (GetRootLayer()->ActiveWorkspace()->Focus() != this) {
|
||||||
DesktopSettings desktopSettings(GetRootLayer()->GetDesktop());
|
DesktopSettings desktopSettings(GetRootLayer()->GetDesktop());
|
||||||
|
|
||||||
// not in FFM mode?
|
// not in FFM mode?
|
||||||
|
|||||||
@@ -96,7 +96,6 @@ Workspace::State::PrintToStream()
|
|||||||
{
|
{
|
||||||
printf("WS::State - Front: %s\n", Front? Front->Name(): "NULL");
|
printf("WS::State - Front: %s\n", Front? Front->Name(): "NULL");
|
||||||
printf("WS::State - Focus: %s\n", Focus? Focus->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) {
|
for (int32 i = 0; i < WindowList.CountItems(); ++i) {
|
||||||
Layer *l = (Layer*)WindowList.ItemAt(i);
|
Layer *l = (Layer*)WindowList.ItemAt(i);
|
||||||
@@ -215,33 +214,24 @@ Workspace::Front() const
|
|||||||
WindowLayer *
|
WindowLayer *
|
||||||
Workspace::Active() const
|
Workspace::Active() const
|
||||||
{
|
{
|
||||||
// in case of a normal or modal window
|
return fFocusItem ? fFocusItem->layerPtr : NULL;
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Method that returns the state of window manager.
|
\brief Method that returns the state of window manager.
|
||||||
\param state - a pointer to a valid Workspace::State structure
|
\param state - a pointer to a valid Workspace::State structure
|
||||||
\return void
|
\return void
|
||||||
|
|
||||||
Fills the state structure with the most important window manager attibutes:
|
Fills the state structure with the most important window manager attibutes:
|
||||||
front window, focus window, active window and the list of windows starting from
|
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.
|
the backmost one at position 0 and ending with the most visible window.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
Workspace::GetState(Workspace::State *state) const
|
Workspace::GetState(Workspace::State *state) const
|
||||||
{
|
{
|
||||||
state->Front = Front();
|
state->Front = Front();
|
||||||
state->Focus = Focus();
|
state->Focus = Focus();
|
||||||
state->Active = Active();
|
|
||||||
|
|
||||||
ListData *cursor = fTopItem;
|
ListData *cursor = fTopItem;
|
||||||
while (cursor) {
|
while (cursor) {
|
||||||
@@ -250,12 +240,15 @@ Workspace::GetState(Workspace::State *state) const
|
|||||||
cursor = cursor->lowerItem;
|
cursor = cursor->lowerItem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
Workspace::AttemptToSetFront(WindowLayer *newFront)
|
Workspace::AttemptToSetFront(WindowLayer *newFront)
|
||||||
{
|
{
|
||||||
return MoveToFront(newFront);
|
return MoveToFront(newFront);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int32
|
int32
|
||||||
Workspace::AttemptToSetFocus(WindowLayer *newFocus)
|
Workspace::AttemptToSetFocus(WindowLayer *newFocus)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -57,7 +57,6 @@ class Workspace {
|
|||||||
|
|
||||||
WindowLayer* Front;
|
WindowLayer* Front;
|
||||||
WindowLayer* Focus;
|
WindowLayer* Focus;
|
||||||
WindowLayer* Active;
|
|
||||||
BList WindowList;
|
BList WindowList;
|
||||||
};
|
};
|
||||||
Workspace( const int32 ID,
|
Workspace( const int32 ID,
|
||||||
|
|||||||
Reference in New Issue
Block a user