From 29769e04520187086e3fed9208d6c0e2b106c6cf Mon Sep 17 00:00:00 2001 From: Alexandre Deckner Date: Sun, 17 Jul 2011 09:51:22 +0000 Subject: [PATCH] * 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 --- src/kits/tracker/ContainerWindow.cpp | 2 +- src/kits/tracker/PoseView.cpp | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/kits/tracker/ContainerWindow.cpp b/src/kits/tracker/ContainerWindow.cpp index 23050429e9..6d18153806 100644 --- a/src/kits/tracker/ContainerWindow.cpp +++ b/src/kits/tracker/ContainerWindow.cpp @@ -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 diff --git a/src/kits/tracker/PoseView.cpp b/src/kits/tracker/PoseView.cpp index 322cf379ba..07b08d291a 100644 --- a/src/kits/tracker/PoseView.cpp +++ b/src/kits/tracker/PoseView.cpp @@ -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) {