.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11709 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
c9df3905a8
commit
9015d08261
@ -789,6 +789,7 @@ int main( int argc, char** argv )
|
||||
if(find_port(SERVER_PORT_NAME)!=B_NAME_NOT_FOUND)
|
||||
return -1;
|
||||
|
||||
srand(real_time_clock_usecs());
|
||||
AppServer app_server;
|
||||
app_server.Run();
|
||||
return 0;
|
||||
|
@ -121,7 +121,7 @@ Layer::~Layer(void)
|
||||
delete fLayerData;
|
||||
fLayerData = NULL;
|
||||
}
|
||||
|
||||
|
||||
if(fName)
|
||||
{
|
||||
delete fName;
|
||||
@ -375,7 +375,7 @@ Layer* Layer::LayerAt(const BPoint &pt)
|
||||
{
|
||||
if (fVisible.Contains(pt))
|
||||
return this;
|
||||
|
||||
|
||||
if (fFullVisible.Contains(pt))
|
||||
{
|
||||
Layer *lay = NULL;
|
||||
@ -645,10 +645,9 @@ void Layer::Draw(const BRect &r)
|
||||
r.PrintToStream();
|
||||
#endif
|
||||
|
||||
// fDriver->FillRect(r, fLayerData->viewcolor);
|
||||
srand(123);
|
||||
RGBColor c(rand()%255,rand()%255,rand()%255);
|
||||
fDriver->FillRect(r, c);
|
||||
fDriver->FillRect(r, fLayerData->viewcolor);
|
||||
// RGBColor c(rand()%255,rand()%255,rand()%255);
|
||||
// fDriver->FillRect(r, c);
|
||||
|
||||
// empty HOOK function.
|
||||
}
|
||||
@ -879,7 +878,6 @@ void Layer::RebuildRegions( const BRegion& reg, uint32 action, BPoint pt, BPoint
|
||||
{
|
||||
fFullVisible.MakeEmpty();
|
||||
fVisible = fFull;
|
||||
|
||||
#ifdef DEBUG_LAYER_REBUILD
|
||||
printf("\n ======= Layer(%s):: RR ****** ======\n", GetName());
|
||||
fFull.PrintToStream();
|
||||
|
@ -326,7 +326,13 @@ Layer* RootLayer::VirtualTopChild() const
|
||||
fWinBorderIndex = fWinBorderCount-1;
|
||||
|
||||
if (fWinBorderIndex < fWinBorderCount && fWinBorderIndex >= 0)
|
||||
return fWinBorderList[fWinBorderIndex--];
|
||||
{
|
||||
WinBorder *wb = fWinBorderList[fWinBorderIndex];
|
||||
fWinBorderIndex--;
|
||||
//printf("Adi: VTC: %p.\n", wb);
|
||||
// return fWinBorderList[fWinBorderIndex--];
|
||||
return wb;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
@ -334,7 +340,13 @@ Layer* RootLayer::VirtualTopChild() const
|
||||
Layer* RootLayer::VirtualLowerSibling() const
|
||||
{
|
||||
if (fWinBorderIndex < fWinBorderCount && fWinBorderIndex > 0)
|
||||
return fWinBorderList[fWinBorderIndex--];
|
||||
{
|
||||
WinBorder *wb = fWinBorderList[fWinBorderIndex];
|
||||
fWinBorderIndex--;
|
||||
//printf("Adi: VLS: %p.\n", wb);
|
||||
return wb;
|
||||
// return fWinBorderList[fWinBorderIndex--];
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
@ -342,7 +354,13 @@ Layer* RootLayer::VirtualLowerSibling() const
|
||||
Layer* RootLayer::VirtualUpperSibling() const
|
||||
{
|
||||
if (fWinBorderIndex < fWinBorderCount && fWinBorderIndex > 0)
|
||||
return fWinBorderList[fWinBorderIndex++];
|
||||
{
|
||||
WinBorder *wb = fWinBorderList[fWinBorderIndex];
|
||||
fWinBorderIndex++;
|
||||
//printf("Adi: VUS: %p.\n", wb);
|
||||
return wb;
|
||||
// return fWinBorderList[fWinBorderIndex++];
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
@ -352,7 +370,13 @@ Layer* RootLayer::VirtualBottomChild() const
|
||||
fWinBorderIndex = 0;
|
||||
|
||||
if (fWinBorderIndex < fWinBorderCount && fWinBorderIndex >= 0)
|
||||
return fWinBorderList[fWinBorderIndex++];
|
||||
{
|
||||
WinBorder *wb = fWinBorderList[fWinBorderIndex];
|
||||
fWinBorderIndex++;
|
||||
//printf("Adi: VBC: %p.\n", wb);
|
||||
return wb;
|
||||
// return fWinBorderList[fWinBorderIndex++];
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
@ -365,7 +389,7 @@ void RootLayer::AddWinBorder(WinBorder* winBorder)
|
||||
debugger("RootLayer::RemoveWinBorder - winBorder must be hidden\n");
|
||||
return;
|
||||
}
|
||||
|
||||
//printf("Adi: AddWinBorder(%p)\n", winBorder);
|
||||
uint32 wks = winBorder->Window()->Workspaces();
|
||||
|
||||
// add to current workspace
|
||||
@ -885,28 +909,30 @@ void RootLayer::MouseEventHandler(int32 code, BPortLink& msg)
|
||||
|
||||
if (invalidate)
|
||||
{
|
||||
WinBorder *focus = FocusWinBorder();
|
||||
get_workspace_windows();
|
||||
|
||||
// TODO: should it be improved by calling with region of hidden windows
|
||||
// plus the full regions of new windows???
|
||||
invalidate_layer(this, fFull);
|
||||
}
|
||||
|
||||
WinBorder *focus = FocusWinBorder();
|
||||
if (exFocus || focus)
|
||||
{
|
||||
if (exFocus && exFocus != focus && exFocus->fDecorator)
|
||||
exFocus->fDecorator->SetFocus(false);
|
||||
if (focus && exFocus != focus && focus->fDecorator)
|
||||
focus->fDecorator->SetFocus(true);
|
||||
|
||||
get_workspace_windows();
|
||||
|
||||
BRegion reg(target->fFull);
|
||||
reg.Include(&target->fTopLayer->fFull);
|
||||
invalidate_layer(this, reg);
|
||||
if (exFocus && FocusWinBorder() != exFocus)
|
||||
if (exFocus && focus != exFocus)
|
||||
{
|
||||
reg.MakeEmpty();
|
||||
reg.Include(&exFocus->fVisible);
|
||||
// TODO: this line is a hack, decorator is drawn twice.
|
||||
reg.Include(&focus->fVisible);
|
||||
BRegion reg(exFocus->fVisible);
|
||||
if (focus)
|
||||
reg.Include(&focus->fVisible);
|
||||
|
||||
redraw_layer(this, reg);
|
||||
}
|
||||
|
||||
if (!(target->Window()->Flags() & B_WILL_ACCEPT_FIRST_CLICK))
|
||||
sendMessage = false;
|
||||
}
|
||||
|
||||
if (action == DEC_DRAG)
|
||||
@ -919,6 +945,9 @@ void RootLayer::MouseEventHandler(int32 code, BPortLink& msg)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!(target->Window()->Flags() & B_WILL_ACCEPT_FIRST_CLICK))
|
||||
sendMessage = false;
|
||||
|
||||
target->Window()->Lock();
|
||||
target->MouseDown(evt, sendMessage);
|
||||
target->Window()->Unlock();
|
||||
@ -1533,21 +1562,25 @@ void RootLayer::show_winBorder(WinBorder *winBorder)
|
||||
{
|
||||
invalid = false;
|
||||
|
||||
if (fWorkspace[i] && fWorkspace[i]->HasWinBorder(winBorder))
|
||||
if (fWorkspace[i] &&
|
||||
(fWorkspace[i]->HasWinBorder(winBorder) ||
|
||||
// floating windows are inserted/removed on-the-fly so this window,
|
||||
// although needed may not be in workspace's list.
|
||||
winBorder->Level() == B_FLOATING_APP))
|
||||
{
|
||||
invalid = fWorkspace[i]->ShowWinBorder(winBorder);
|
||||
}
|
||||
|
||||
if (fActiveWksIndex == i)
|
||||
invalidate = invalid;
|
||||
}
|
||||
|
||||
get_workspace_windows();
|
||||
|
||||
if (invalidate)
|
||||
{
|
||||
BRegion reg(winBorder->fFull);
|
||||
reg.Include(&winBorder->fTopLayer->fFull);
|
||||
invalidate_layer(this, reg);
|
||||
// invalidate_layer(this, winBorder->fFull);
|
||||
// TODO: should it be improved by calling with region of hidden windows
|
||||
// plus the full regions of new windows???
|
||||
invalidate_layer(this, fFull);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1573,7 +1606,9 @@ void RootLayer::hide_winBorder(WinBorder *winBorder)
|
||||
|
||||
if (invalidate)
|
||||
{
|
||||
invalidate_layer(this, winBorder->fFullVisible);
|
||||
// TODO: should it be improved by calling with region of hidden windows
|
||||
// plus the full regions of new windows???
|
||||
invalidate_layer(this, fFull);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1594,4 +1629,10 @@ void RootLayer::get_workspace_windows()
|
||||
fWinBorderCount = bufferSize;
|
||||
|
||||
fWinBorderIndex = 0;
|
||||
}
|
||||
//for (int32 i = 0; i < fWinBorderCount; i++)
|
||||
//{
|
||||
// printf("Adi: %ld get_workspace_windows(%p)\n", i, fWinBorderList[i]);
|
||||
//}
|
||||
//printf("Adi: get_workspace_windows DONE\n");
|
||||
}
|
||||
|
||||
|
@ -164,9 +164,9 @@ friend class Desktop;
|
||||
int32 fActiveWksIndex;
|
||||
int32 fWsCount;
|
||||
Workspace* fWorkspace[32];
|
||||
mutable WinBorder** fWinBorderList2;
|
||||
mutable WinBorder** fWinBorderList;
|
||||
mutable int32 fWinBorderCount;
|
||||
WinBorder** fWinBorderList2;
|
||||
WinBorder** fWinBorderList;
|
||||
int32 fWinBorderCount;
|
||||
mutable int32 fWinBorderIndex;
|
||||
int32 fWinBorderListLength;
|
||||
|
||||
|
@ -800,7 +800,7 @@ STRACE(("W(%ld)::ShowWinBorder(%s) \n", fID, winBorder? winBorder->GetName(): "N
|
||||
}
|
||||
else
|
||||
{
|
||||
// none of the unhiden normal windows have this window as part of their subset.
|
||||
// none of the unhiden normal windows havs this window as part of its subset.
|
||||
// as a result this window won't be added to Workspace's list for it to be shown.
|
||||
return false;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user