Bug 428680: Sometimes, the document node is the event target for mousemove events now, patch by Matthew Gregan <kinetik@flim.org>, r=smaug, sr=roc, a=damon

This commit is contained in:
gavin%gavinsharp.com 2008-04-23 22:51:27 +00:00
Родитель 6680476361
Коммит a1c69ef130
2 изменённых файлов: 14 добавлений и 5 удалений

Просмотреть файл

@ -833,10 +833,11 @@ nsEventStateManager::PreHandleEvent(nsPresContext* aPresContext,
{
nsMouseEvent* mouseEvent = static_cast<nsMouseEvent*>(aEvent);
if (mouseEvent->exit != nsMouseEvent::eTopLevel) {
// treat it as a move so we don't generate spurious "exit"
// events Any necessary exit events will be generated by
// GenerateMouseEnterExit
aEvent->message = NS_MOUSE_MOVE;
// Treat it as a synthetic move so we don't generate spurious
// "exit" or "move" events. Any necessary "out" or "over" events
// will be generated by GenerateMouseEnterExit
mouseEvent->message = NS_MOUSE_MOVE;
mouseEvent->reason = nsMouseEvent::eSynthesized;
// then fall through...
} else {
GenerateMouseEnterExit((nsGUIEvent*)aEvent);

Просмотреть файл

@ -5740,7 +5740,15 @@ static PRBool IsTopLevelMouseExit(HWND aWnd)
POINT mp;
mp.x = GET_X_LPARAM(pos);
mp.y = GET_Y_LPARAM(pos);
HWND mouseTopLevel = nsWindow::GetTopLevelHWND(::WindowFromPoint(mp));
HWND mouseWnd = ::WindowFromPoint(mp);
// GetTopLevelHWND will return a HWND for the window frame (which includes
// the non-client area). If the mouse has moved into the non-client area,
// we should treat it as a top-level exit.
HWND mouseTopLevel = nsWindow::GetTopLevelHWND(mouseWnd, false);
if (mouseWnd == mouseTopLevel)
return PR_TRUE;
return nsWindow::GetTopLevelHWND(aWnd) != mouseTopLevel;
}