* solved that damn bug that run me into debugger. yuppyyy.

* removed some comments
* mouse down messages go only to the view that has focus. Yeah, they didn't. :p
* solved a bug where some windows did not redraw when hiding a modal.
* another bug where a floating window would not come in front for gaining focus.
* added client's team_id into window title.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@11918 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Adi Oanca
2005-03-19 18:58:47 +00:00
parent b55be0692f
commit 07bde8ab89
5 changed files with 23 additions and 50 deletions
-10
View File
@@ -424,16 +424,6 @@ void Desktop::RemoveWinBorderFromSubset(WinBorder *winBorder, WinBorder *fromWin
Unlock();
}
inline
bool Desktop::HasWinBorder(WinBorder *winBorder)
{
bool isIn = false;
Lock();
isIn = fWinBorderList.HasItem(winBorder);
Unlock();
return isIn;
}
WinBorder* Desktop::FindWinBorderByServerWindowTokenAndTeamID(int32 token, team_id teamID)
{
WinBorder* wb;
-1
View File
@@ -69,7 +69,6 @@ public:
void RemoveWinBorder(WinBorder *winBorder);
void AddWinBorderToSubset(WinBorder *winBorder, WinBorder *toWinBorder);
void RemoveWinBorderFromSubset(WinBorder *winBorder, WinBorder *fromWinBorder);
bool HasWinBorder(WinBorder *winBorder);
WinBorder* FindWinBorderByServerWindowTokenAndTeamID(int32 token, team_id teamID);
// get list of registed windows
+14 -35
View File
@@ -344,13 +344,7 @@ Layer* RootLayer::VirtualTopChild() const
fWinBorderIndex = fWinBorderCount-1;
if (fWinBorderIndex < fWinBorderCount && fWinBorderIndex >= 0)
{
WinBorder *wb = fWinBorderList[fWinBorderIndex];
fWinBorderIndex--;
//printf("Adi: VTC: %p.\n", wb);
// return fWinBorderList[fWinBorderIndex--];
return wb;
}
return fWinBorderList[fWinBorderIndex--];
return NULL;
}
@@ -358,13 +352,7 @@ Layer* RootLayer::VirtualTopChild() const
Layer* RootLayer::VirtualLowerSibling() const
{
if (fWinBorderIndex < fWinBorderCount && fWinBorderIndex > 0)
{
WinBorder *wb = fWinBorderList[fWinBorderIndex];
fWinBorderIndex--;
//printf("Adi: VLS: %p.\n", wb);
return wb;
// return fWinBorderList[fWinBorderIndex--];
}
return fWinBorderList[fWinBorderIndex--];
return NULL;
}
@@ -372,13 +360,7 @@ Layer* RootLayer::VirtualLowerSibling() const
Layer* RootLayer::VirtualUpperSibling() const
{
if (fWinBorderIndex < fWinBorderCount && fWinBorderIndex > 0)
{
WinBorder *wb = fWinBorderList[fWinBorderIndex];
fWinBorderIndex++;
//printf("Adi: VUS: %p.\n", wb);
return wb;
// return fWinBorderList[fWinBorderIndex++];
}
return fWinBorderList[fWinBorderIndex++];
return NULL;
}
@@ -388,13 +370,7 @@ Layer* RootLayer::VirtualBottomChild() const
fWinBorderIndex = 0;
if (fWinBorderIndex < fWinBorderCount && fWinBorderIndex >= 0)
{
WinBorder *wb = fWinBorderList[fWinBorderIndex];
fWinBorderIndex++;
//printf("Adi: VBC: %p.\n", wb);
return wb;
// return fWinBorderList[fWinBorderIndex++];
}
return fWinBorderList[fWinBorderIndex++];
return NULL;
}
@@ -966,8 +942,10 @@ void RootLayer::MouseEventHandler(int32 code, BPortLink& msg)
}
else
{
if (exFocus != FocusWinBorder()
&& !(target->Window()->Flags() & B_WILL_ACCEPT_FIRST_CLICK))
if (target != FocusWinBorder())
sendMessage = false;
else if (exFocus != FocusWinBorder()
&& !(target->Window()->Flags() & B_WILL_ACCEPT_FIRST_CLICK))
sendMessage = false;
target->MouseDown(evt, sendMessage);
@@ -1000,7 +978,8 @@ void RootLayer::MouseEventHandler(int32 code, BPortLink& msg)
// currently mouse up goes to the same window which received mouse down
if (fMouseTarget)
{
fMouseTarget->MouseUp(evt);
if (fMouseTarget == FocusWinBorder())
fMouseTarget->MouseUp(evt);
fMouseTarget = NULL;
}
@@ -1562,6 +1541,10 @@ void RootLayer::show_winBorder(WinBorder *winBorder)
if (fWorkspace[i] &&
(fWorkspace[i]->HasWinBorder(winBorder) ||
// subset modals are a bit like floating windows, they are being added
// and removed from workspace when there's at least a normal window
// that uses them.
winBorder->Level() == B_MODAL_APP ||
// 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))
@@ -1649,10 +1632,6 @@ void RootLayer::get_workspace_windows()
if (!present)
empty_visible_regions(fWinBorderList2[i]);
// {
// fWinBorderList2[i]->fVisible.MakeEmpty();
// fWinBorderList2[i]->fFullVisible.MakeEmpty();
// }
}
// enlarge 2nd buffer also
+7 -2
View File
@@ -198,7 +198,9 @@ ServerWindow::ServerWindow(BRect rect, const char *string, uint32 wlook,
//------------------------------------------------------------------------------
void ServerWindow::Init(void)
{
fWinBorder = new WinBorder( fFrame, fTitle.String(), fLook, fFeel, 0UL,
char newName[256];
sprintf(newName, "%ld: %s", fClientTeamID, fTitle.String());
fWinBorder = new WinBorder( fFrame, newName, fLook, fFeel, 0UL,
this, desktop->GetDisplayDriver());
// Spawn our message-monitoring thread
@@ -1166,7 +1168,10 @@ void ServerWindow::DispatchMessage(int32 code, LinkMsgReader &link)
case AS_LAYER_CLIP_TO_PICTURE:
{
DTRACE(("ServerWindow %s: Message AS_LAYER_CLIP_TO_PICTURE: Layer: %s\n",fTitle.String(), cl->fName->String()));
// TODO: you are not allowed to use Layer regions here!!!
// If there is no other way, then first lock RootLayer object first.
// TODO: Watch out for the coordinate system in AS_LAYER_CLIP_TO_PICTURE
int32 pictureToken;
BPoint where;
+2 -2
View File
@@ -251,7 +251,7 @@ bool Workspace::GetWinBorderList(void **list, int32 *itemCount ) const
}
}
return false;
return true;
}
//----------------------------------------------------------------------------------
@@ -589,7 +589,7 @@ STRACE(("W(%ld)::HideWinBorder(%s) \n", fID, winBorder? winBorder->GetName(): "N
fFocusItem = NULL;
newFront = findNextFront();
if (newFront)
MoveToFront(newFront->layerPtr);
returnValue = MoveToFront(newFront->layerPtr);
}
// floating windows can have focus state. what if this removed window is