зеркало из https://github.com/mozilla/pjs.git
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:
Родитель
6680476361
Коммит
a1c69ef130
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче