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)
|
if(find_port(SERVER_PORT_NAME)!=B_NAME_NOT_FOUND)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
srand(real_time_clock_usecs());
|
||||||
AppServer app_server;
|
AppServer app_server;
|
||||||
app_server.Run();
|
app_server.Run();
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -645,10 +645,9 @@ void Layer::Draw(const BRect &r)
|
||||||
r.PrintToStream();
|
r.PrintToStream();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// fDriver->FillRect(r, fLayerData->viewcolor);
|
fDriver->FillRect(r, fLayerData->viewcolor);
|
||||||
srand(123);
|
// RGBColor c(rand()%255,rand()%255,rand()%255);
|
||||||
RGBColor c(rand()%255,rand()%255,rand()%255);
|
// fDriver->FillRect(r, c);
|
||||||
fDriver->FillRect(r, c);
|
|
||||||
|
|
||||||
// empty HOOK function.
|
// empty HOOK function.
|
||||||
}
|
}
|
||||||
|
@ -879,7 +878,6 @@ void Layer::RebuildRegions( const BRegion& reg, uint32 action, BPoint pt, BPoint
|
||||||
{
|
{
|
||||||
fFullVisible.MakeEmpty();
|
fFullVisible.MakeEmpty();
|
||||||
fVisible = fFull;
|
fVisible = fFull;
|
||||||
|
|
||||||
#ifdef DEBUG_LAYER_REBUILD
|
#ifdef DEBUG_LAYER_REBUILD
|
||||||
printf("\n ======= Layer(%s):: RR ****** ======\n", GetName());
|
printf("\n ======= Layer(%s):: RR ****** ======\n", GetName());
|
||||||
fFull.PrintToStream();
|
fFull.PrintToStream();
|
||||||
|
|
|
@ -326,7 +326,13 @@ Layer* RootLayer::VirtualTopChild() const
|
||||||
fWinBorderIndex = fWinBorderCount-1;
|
fWinBorderIndex = fWinBorderCount-1;
|
||||||
|
|
||||||
if (fWinBorderIndex < fWinBorderCount && fWinBorderIndex >= 0)
|
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;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -334,7 +340,13 @@ Layer* RootLayer::VirtualTopChild() const
|
||||||
Layer* RootLayer::VirtualLowerSibling() const
|
Layer* RootLayer::VirtualLowerSibling() const
|
||||||
{
|
{
|
||||||
if (fWinBorderIndex < fWinBorderCount && fWinBorderIndex > 0)
|
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;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -342,7 +354,13 @@ Layer* RootLayer::VirtualLowerSibling() const
|
||||||
Layer* RootLayer::VirtualUpperSibling() const
|
Layer* RootLayer::VirtualUpperSibling() const
|
||||||
{
|
{
|
||||||
if (fWinBorderIndex < fWinBorderCount && fWinBorderIndex > 0)
|
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;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -352,7 +370,13 @@ Layer* RootLayer::VirtualBottomChild() const
|
||||||
fWinBorderIndex = 0;
|
fWinBorderIndex = 0;
|
||||||
|
|
||||||
if (fWinBorderIndex < fWinBorderCount && 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;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -365,7 +389,7 @@ void RootLayer::AddWinBorder(WinBorder* winBorder)
|
||||||
debugger("RootLayer::RemoveWinBorder - winBorder must be hidden\n");
|
debugger("RootLayer::RemoveWinBorder - winBorder must be hidden\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
//printf("Adi: AddWinBorder(%p)\n", winBorder);
|
||||||
uint32 wks = winBorder->Window()->Workspaces();
|
uint32 wks = winBorder->Window()->Workspaces();
|
||||||
|
|
||||||
// add to current workspace
|
// add to current workspace
|
||||||
|
@ -885,28 +909,30 @@ void RootLayer::MouseEventHandler(int32 code, BPortLink& msg)
|
||||||
|
|
||||||
if (invalidate)
|
if (invalidate)
|
||||||
{
|
{
|
||||||
|
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();
|
WinBorder *focus = FocusWinBorder();
|
||||||
|
if (exFocus || focus)
|
||||||
|
{
|
||||||
if (exFocus && exFocus != focus && exFocus->fDecorator)
|
if (exFocus && exFocus != focus && exFocus->fDecorator)
|
||||||
exFocus->fDecorator->SetFocus(false);
|
exFocus->fDecorator->SetFocus(false);
|
||||||
if (focus && exFocus != focus && focus->fDecorator)
|
if (focus && exFocus != focus && focus->fDecorator)
|
||||||
focus->fDecorator->SetFocus(true);
|
focus->fDecorator->SetFocus(true);
|
||||||
|
|
||||||
get_workspace_windows();
|
if (exFocus && focus != exFocus)
|
||||||
|
|
||||||
BRegion reg(target->fFull);
|
|
||||||
reg.Include(&target->fTopLayer->fFull);
|
|
||||||
invalidate_layer(this, reg);
|
|
||||||
if (exFocus && FocusWinBorder() != exFocus)
|
|
||||||
{
|
{
|
||||||
reg.MakeEmpty();
|
|
||||||
reg.Include(&exFocus->fVisible);
|
|
||||||
// TODO: this line is a hack, decorator is drawn twice.
|
// TODO: this line is a hack, decorator is drawn twice.
|
||||||
|
BRegion reg(exFocus->fVisible);
|
||||||
|
if (focus)
|
||||||
reg.Include(&focus->fVisible);
|
reg.Include(&focus->fVisible);
|
||||||
|
|
||||||
redraw_layer(this, reg);
|
redraw_layer(this, reg);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(target->Window()->Flags() & B_WILL_ACCEPT_FIRST_CLICK))
|
|
||||||
sendMessage = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (action == DEC_DRAG)
|
if (action == DEC_DRAG)
|
||||||
|
@ -919,6 +945,9 @@ void RootLayer::MouseEventHandler(int32 code, BPortLink& msg)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (!(target->Window()->Flags() & B_WILL_ACCEPT_FIRST_CLICK))
|
||||||
|
sendMessage = false;
|
||||||
|
|
||||||
target->Window()->Lock();
|
target->Window()->Lock();
|
||||||
target->MouseDown(evt, sendMessage);
|
target->MouseDown(evt, sendMessage);
|
||||||
target->Window()->Unlock();
|
target->Window()->Unlock();
|
||||||
|
@ -1533,21 +1562,25 @@ void RootLayer::show_winBorder(WinBorder *winBorder)
|
||||||
{
|
{
|
||||||
invalid = false;
|
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);
|
invalid = fWorkspace[i]->ShowWinBorder(winBorder);
|
||||||
|
}
|
||||||
|
|
||||||
if (fActiveWksIndex == i)
|
if (fActiveWksIndex == i)
|
||||||
invalidate = invalid;
|
invalidate = invalid;
|
||||||
}
|
}
|
||||||
|
|
||||||
get_workspace_windows();
|
get_workspace_windows();
|
||||||
|
|
||||||
if (invalidate)
|
if (invalidate)
|
||||||
{
|
{
|
||||||
BRegion reg(winBorder->fFull);
|
// TODO: should it be improved by calling with region of hidden windows
|
||||||
reg.Include(&winBorder->fTopLayer->fFull);
|
// plus the full regions of new windows???
|
||||||
invalidate_layer(this, reg);
|
invalidate_layer(this, fFull);
|
||||||
// invalidate_layer(this, winBorder->fFull);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1573,7 +1606,9 @@ void RootLayer::hide_winBorder(WinBorder *winBorder)
|
||||||
|
|
||||||
if (invalidate)
|
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;
|
fWinBorderCount = bufferSize;
|
||||||
|
|
||||||
fWinBorderIndex = 0;
|
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 fActiveWksIndex;
|
||||||
int32 fWsCount;
|
int32 fWsCount;
|
||||||
Workspace* fWorkspace[32];
|
Workspace* fWorkspace[32];
|
||||||
mutable WinBorder** fWinBorderList2;
|
WinBorder** fWinBorderList2;
|
||||||
mutable WinBorder** fWinBorderList;
|
WinBorder** fWinBorderList;
|
||||||
mutable int32 fWinBorderCount;
|
int32 fWinBorderCount;
|
||||||
mutable int32 fWinBorderIndex;
|
mutable int32 fWinBorderIndex;
|
||||||
int32 fWinBorderListLength;
|
int32 fWinBorderListLength;
|
||||||
|
|
||||||
|
|
|
@ -800,7 +800,7 @@ STRACE(("W(%ld)::ShowWinBorder(%s) \n", fID, winBorder? winBorder->GetName(): "N
|
||||||
}
|
}
|
||||||
else
|
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.
|
// as a result this window won't be added to Workspace's list for it to be shown.
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue