Fixed window selection with the mouse. Works fine only for normal windows. Next: same thing for modal and floating windows.

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8254 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Adi Oanca 2004-07-01 20:01:32 +00:00
parent d194a7c235
commit cebad2e20f

View File

@ -397,10 +397,12 @@ void Desktop::MouseEventHandler(PortMessage *msg)
{
fGeneralLock.Lock();
rl->fMainLock.Lock();
// TODO: it's not that good to use fMouseTarget.
// (you have problems with B_MOUSE_UP, you know... :-)))
// Yes, I know. But it's too late tonight. :-)))
if (target != fMouseTarget)
#if 0
printf("Target: %s\n", target->GetName());
printf("Front: %s\n", ws->FrontLayer()->GetName());
printf("Focus: %s\n", ws->FocusLayer()->GetName());
#endif
if (target != ws->FrontLayer())
{
WinBorder *previousFocus;
WinBorder *activeFocus;
@ -415,6 +417,8 @@ void Desktop::MouseEventHandler(PortMessage *msg)
if (target == activeFocus && target->Window()->Flags() & B_WILL_ACCEPT_FIRST_CLICK)
target->MouseDown(msg, true);
else
target->MouseDown(msg, false);
// may be or may be empty.
// TODO: what if modal of floating windows are in front of us?
@ -432,11 +436,16 @@ void Desktop::MouseEventHandler(PortMessage *msg)
}
}
fMouseTarget = activeFocus;
fMouseTarget = target;
#if 0
printf("2Target: %s\n", target->GetName());
printf("2Front: %s\n", ws->FrontLayer()->GetName());
printf("2Focus: %s\n", ws->FocusLayer()->GetName());
#endif
activeFocus->Window()->Unlock();
}
else // target == fMouseTarget
else // target == ws->FrontLayer()
{
// only if target has the focus!
if (target == ws->FocusLayer())