From 1e367fecba14c14c40c4f9a0320e9bf24da8c7fd Mon Sep 17 00:00:00 2001 From: Adi Oanca Date: Mon, 28 Jun 2004 21:38:16 +0000 Subject: [PATCH] Used the new RebuildAndForceRedraw() method. Just that. Sorry, cannot concentrate this late. :-( git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8227 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/servers/app/server/Desktop.cpp | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/src/servers/app/server/Desktop.cpp b/src/servers/app/server/Desktop.cpp index b63f265043..c9c447fba0 100644 --- a/src/servers/app/server/Desktop.cpp +++ b/src/servers/app/server/Desktop.cpp @@ -20,7 +20,7 @@ // DEALINGS IN THE SOFTWARE. // // File Name: Desktop.cpp -// Author: Adi Oanca +// Author: Adi Oanca // Description: Class used to encapsulate desktop management // //------------------------------------------------------------------------------ @@ -417,18 +417,10 @@ void Desktop::MouseEventHandler(PortMessage *msg) target->MouseDown(msg, true); // may be or may be empty. +// TODO: what if modal of floating windows are in front of us? invalidRegion.Include(&(activeFocus->fFull)); invalidRegion.Include(&(activeFocus->fTopLayer->fFull)); - activeFocus->fParent->FullInvalidate(invalidRegion); -// TODO: this is a hack! Should be something like this: -// void Layer::RebuildAndForceRedraw(invalidReg, target){ -// BPoint pt(0,0); -// StartRebuildRegions(invalidRegion, NULL, B_LAYER_NONE, pt); -// if (target) gRedrawReg.Include(target->fFullVisible); -// Redraw(gRedrawReg); -// } -// called like: target->fParent->RebuildAndForceRedraw(reg, target); - activeFocus->fParent->Invalidate(invalidRegion); + activeFocus->fParent->RebuildAndForceRedraw(invalidRegion, activeFocus); if (previousFocus != activeFocus && previousFocus) { @@ -446,9 +438,13 @@ void Desktop::MouseEventHandler(PortMessage *msg) } else // target == fMouseTarget { - target->Window()->Lock(); - target->MouseDown(msg, true); - target->Window()->Unlock(); + // only if target has the focus! + if (target == ws->FocusLayer()) + { + target->Window()->Lock(); + target->MouseDown(msg, true); + target->Window()->Unlock(); + } } rl->fMainLock.Unlock(); @@ -473,7 +469,7 @@ void Desktop::MouseEventHandler(PortMessage *msg) fMouseTarget->MouseUp(msg); fMouseTarget->Window()->Unlock(); -// fMouseTarget = NULL; + fMouseTarget = NULL; } else {