Not in mood for too much coding, I had a look through the code tonight. And guess what? Like Stefano
the other day, I discovered, not a bug, but how to invalidate only the area that requires it when changing window order (selecting or moving to back a window). Stuppid me, that stuff didn't worked because I forgot how windows were arranged in the list returned by Workspace::GetWMState(). I was iterating the wrong way! :-) git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14839 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -302,27 +302,27 @@ RootLayer::ResizeBy(float x, float y)
|
||||
Layer*
|
||||
RootLayer::FirstChild() const
|
||||
{
|
||||
fWinBorderIndex = fWMState.WindowList.CountItems()-1;
|
||||
return static_cast<Layer*>(fWMState.WindowList.ItemAt(fWinBorderIndex--));
|
||||
fWinBorderIndex = 0;
|
||||
return static_cast<Layer*>(fWMState.WindowList.ItemAt(fWinBorderIndex++));
|
||||
}
|
||||
|
||||
Layer*
|
||||
RootLayer::NextChild() const
|
||||
{
|
||||
return static_cast<Layer*>(fWMState.WindowList.ItemAt(fWinBorderIndex--));
|
||||
return static_cast<Layer*>(fWMState.WindowList.ItemAt(fWinBorderIndex++));
|
||||
}
|
||||
|
||||
Layer*
|
||||
RootLayer::PreviousChild() const
|
||||
{
|
||||
return static_cast<Layer*>(fWMState.WindowList.ItemAt(fWinBorderIndex++));
|
||||
return static_cast<Layer*>(fWMState.WindowList.ItemAt(fWinBorderIndex--));
|
||||
}
|
||||
|
||||
Layer*
|
||||
RootLayer::LastChild() const
|
||||
{
|
||||
fWinBorderIndex = 0;
|
||||
return static_cast<Layer*>(fWMState.WindowList.ItemAt(fWinBorderIndex++));
|
||||
fWinBorderIndex = fWMState.WindowList.CountItems()-1;
|
||||
return static_cast<Layer*>(fWMState.WindowList.ItemAt(fWinBorderIndex--));
|
||||
}
|
||||
|
||||
|
||||
@@ -836,6 +836,7 @@ RootLayer::RevealNewWMState(Workspace::State &oldWMState)
|
||||
}
|
||||
}
|
||||
|
||||
// for new windows, invalidate(rebuild & redraw) the maximum that it can occupy.
|
||||
for (int32 i = 0; i < newWindowCount; ++i) {
|
||||
Layer *layer = static_cast<Layer*>(fWMState.WindowList.ItemAtFast(i));
|
||||
if (!layer)
|
||||
@@ -849,6 +850,8 @@ RootLayer::RevealNewWMState(Workspace::State &oldWMState)
|
||||
}
|
||||
if (isNewWindow) {
|
||||
BRegion invalid;
|
||||
|
||||
// invalidate the maximum area which this layer/window can occupy.
|
||||
layer->GetWantedRegion(invalid);
|
||||
|
||||
MarkForRebuild(invalid);
|
||||
@@ -859,6 +862,7 @@ RootLayer::RevealNewWMState(Workspace::State &oldWMState)
|
||||
}
|
||||
}
|
||||
|
||||
// if a window came in front ot others, invalidate its previously hidden area.
|
||||
oldWindowCount = oldStrippedList.CountItems();
|
||||
newWindowCount = newStrippedList.CountItems();
|
||||
for (int32 i = 0; i < oldWindowCount; ++i) {
|
||||
@@ -867,11 +871,12 @@ RootLayer::RevealNewWMState(Workspace::State &oldWMState)
|
||||
continue;
|
||||
if (i < newStrippedList.IndexOf(layer)) {
|
||||
BRegion invalid;
|
||||
|
||||
// start by invalidating the maximum area which this layer/window can occupy.
|
||||
layer->GetWantedRegion(invalid);
|
||||
|
||||
// TODO: we need to invalidate only the ares that became visible
|
||||
// not the whole surface of this layer!
|
||||
// invalid.Exclude(&layer->FullVisible());
|
||||
// no reason to invalidate what's currently visible.
|
||||
invalid.Exclude(&layer->FullVisible());
|
||||
|
||||
MarkForRebuild(invalid);
|
||||
MarkForRedraw(invalid);
|
||||
|
||||
@@ -227,6 +227,15 @@ Workspace::Active() const
|
||||
return 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.
|
||||
*/
|
||||
void
|
||||
Workspace::GetState(Workspace::State *state) const
|
||||
{
|
||||
@@ -234,11 +243,11 @@ Workspace::GetState(Workspace::State *state) const
|
||||
state->Focus = Focus();
|
||||
state->Active = Active();
|
||||
|
||||
ListData *cursor = fBottomItem;
|
||||
ListData *cursor = fTopItem;
|
||||
while (cursor) {
|
||||
if (!cursor->layerPtr->IsHidden())
|
||||
state->WindowList.AddItem(cursor->layerPtr);
|
||||
cursor = cursor->upperItem;
|
||||
cursor = cursor->lowerItem;
|
||||
}
|
||||
}
|
||||
bool
|
||||
|
||||
Reference in New Issue
Block a user