* Don't do anything in MouseIdle if we're not dragging a message.

This especially avoid bringing tracker windows up to front when staying idle
over a tracker window while holding down a button. This could happen when
hovering while still holding a scroll thumb of another overlapping window.

Fixes regression #7829 introduced in r41892

* Also properly reinitialise the cached dragMessage on B_EXITED_VIEW, 
otherwise it would still think it is dragging and thus still pass through my
above fix.

I'd like to cleanup the drag message caching mechanism as it's not 
pretty in my opinion. Possibly even adding it to BView.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42441 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Alexandre Deckner 2011-07-17 09:51:22 +00:00
parent b2a7732258
commit 29769e0452
2 changed files with 8 additions and 4 deletions

View File

@ -3790,7 +3790,7 @@ BContainerWindow::SaveWindowState(BMessage &message) const
status_t
BContainerWindow::DragStart(const BMessage *incoming)
{
if (!incoming)
if (incoming == NULL)
return B_ERROR;
// if already dragging, or

View File

@ -6709,14 +6709,14 @@ BPoseView::MouseMoved(BPoint mouseLoc, uint32 moveCode, const BMessage *message)
if (fSelectionRectInfo.isDragging)
_UpdateSelectionRect(mouseLoc);
if (!fDropEnabled || !message)
if (!fDropEnabled || message == NULL)
return;
BContainerWindow* window = ContainerWindow();
if (!window)
return;
if (message != NULL && !window->Dragging())
if (!window->Dragging())
window->DragStart(message);
switch (moveCode) {
@ -6731,6 +6731,7 @@ BPoseView::MouseMoved(BPoint mouseLoc, uint32 moveCode, const BMessage *message)
break;
case B_EXITED_VIEW:
DragStop();
// reset cursor in case we set it to the copy cursor
// in UpdateDropTarget
SetViewCursor(B_CURSOR_SYSTEM_DEFAULT);
@ -6786,9 +6787,12 @@ BPoseView::MouseIdle(const BMessage *message)
BPoint where;
uint32 buttons = 0;
GetMouse(&where, &buttons);
// We could retrieve 'where' from the incoming
// message but we need the buttons state anyway
// and B_MOUSE_IDLE message doesn't pass it
BContainerWindow* window = ContainerWindow();
if (buttons == 0 || window == NULL)
if (buttons == 0 || window == NULL || !window->Dragging())
return;
if (fDropTarget != NULL) {