Fixed window focus state drawing in ServerWindow::Show(). Changing focus with the mouse does not work, yet. Tomorrow, I'll fix that.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8058 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -634,9 +634,6 @@ void RootLayer::SetActiveWorkspace(Workspace *ws)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
fActiveWorkspace = ws;
|
fActiveWorkspace = ws;
|
||||||
|
|
||||||
// RebuildRegions(Frame());
|
|
||||||
// Invalidate(Frame());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int32 RootLayer::ActiveWorkspaceIndex() const{
|
int32 RootLayer::ActiveWorkspaceIndex() const{
|
||||||
@@ -656,8 +653,6 @@ void RootLayer::SetBGColor(const RGBColor &col)
|
|||||||
ActiveWorkspace()->SetBGColor(col);
|
ActiveWorkspace()->SetBGColor(col);
|
||||||
|
|
||||||
fLayerData->viewcolor = col;
|
fLayerData->viewcolor = col;
|
||||||
|
|
||||||
// Invalidate(Frame());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
RGBColor RootLayer::BGColor(void) const
|
RGBColor RootLayer::BGColor(void) const
|
||||||
|
|||||||
@@ -289,7 +289,8 @@ void ServerWindow::Show(void)
|
|||||||
rl->fMainLock.Lock();
|
rl->fMainLock.Lock();
|
||||||
STRACE(("ServerWindow(%s)::Show() - Main lock acquired\n", fWinBorder->GetName()));
|
STRACE(("ServerWindow(%s)::Show() - Main lock acquired\n", fWinBorder->GetName()));
|
||||||
|
|
||||||
// TODO: 'false' couldn't this be made otherwise???
|
// make WinBorder unhidden, but *do not* rebuild and redraw! We'll do that
|
||||||
|
// after we bring it (its modal and floating windows also) in front.
|
||||||
fWinBorder->Show(false);
|
fWinBorder->Show(false);
|
||||||
|
|
||||||
if ( (fFeel == B_FLOATING_SUBSET_WINDOW_FEEL || fFeel == B_MODAL_SUBSET_WINDOW_FEEL)
|
if ( (fFeel == B_FLOATING_SUBSET_WINDOW_FEEL || fFeel == B_MODAL_SUBSET_WINDOW_FEEL)
|
||||||
@@ -305,19 +306,30 @@ void ServerWindow::Show(void)
|
|||||||
{
|
{
|
||||||
if (fWorkspaces & (0x00000001UL << i))
|
if (fWorkspaces & (0x00000001UL << i))
|
||||||
{
|
{
|
||||||
Workspace *ws = rl->WorkspaceAt(i+1);
|
WinBorder *previousFocus;
|
||||||
|
BRegion invalidRegion;
|
||||||
|
Workspace *ws;
|
||||||
|
|
||||||
|
ws = rl->WorkspaceAt(i+1);
|
||||||
ws->BringToFrontANormalWindow(fWinBorder);
|
ws->BringToFrontANormalWindow(fWinBorder);
|
||||||
ws->SearchAndSetNewFront(fWinBorder);
|
ws->SearchAndSetNewFront(fWinBorder);
|
||||||
|
previousFocus = ws->FocusLayer();
|
||||||
ws->SetFocusLayer(fWinBorder);
|
ws->SetFocusLayer(fWinBorder);
|
||||||
// TODO: this is UGLY.
|
|
||||||
// Normaly you have to easy pass a "FullInvalidate". But in this case, WinBorder
|
|
||||||
// is children dependant, so we CANOT rely on ANY region (full, fullVisible, visible)
|
|
||||||
// You have to figure out a way to do this 'internaly', I mean add support in
|
|
||||||
// Layer::FullInvalidate or Layer::[Start]RebuildRegions()
|
|
||||||
|
|
||||||
// What we are doinf here is BAD. We pass a rectangle instead of a region. Some areas may
|
// first redraw previous window's decorator. It has lost focus state.
|
||||||
// ger redrawed while there is no need for that!!!
|
if (previousFocus)
|
||||||
fWinBorder->fParent->FullInvalidate(fWinBorder->fFull.Frame());
|
if (previousFocus->fDecorator)
|
||||||
|
fWinBorder->fParent->Invalidate(previousFocus->fVisible);
|
||||||
|
|
||||||
|
// we must build the rebuild region. we have nowhere to take it from.
|
||||||
|
// include decorator's(if any) and fTopLayer's full regions.
|
||||||
|
fTopLayer->RebuildFullRegion();
|
||||||
|
fWinBorder->RebuildFullRegion();
|
||||||
|
invalidRegion.Include(&(fTopLayer->fFull));
|
||||||
|
if (fWinBorder->fDecorator)
|
||||||
|
invalidRegion.Include(&(fWinBorder->fFull));
|
||||||
|
|
||||||
|
fWinBorder->fParent->FullInvalidate(invalidRegion);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -343,10 +343,10 @@ WinBorder* Workspace::SearchWinBorder(BPoint pt){
|
|||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
void Workspace::Invalidate(){
|
void Workspace::Invalidate(){
|
||||||
//TODO: *****!*!*!*!*!*!*!**!***REMOVE this! For Test purposes only!
|
//TODO: *****!*!*!*!*!*!*!**!***REMOVE this! For Test purposes only!
|
||||||
opLock.Lock();
|
/* opLock.Lock();
|
||||||
if(fOwner->ActiveWorkspace() == this)
|
if(fOwner->ActiveWorkspace() == this)
|
||||||
fOwner->FullInvalidate(fOwner->Bounds());
|
fOwner->FullInvalidate(fOwner->Bounds());
|
||||||
opLock.Unlock();
|
opLock.Unlock();*/
|
||||||
//----------------
|
//----------------
|
||||||
}
|
}
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user