Bug 1163044 - Forward NS_MOUSE_ENTER_WIDGET into content process. r=smaug

This commit is contained in:
Maksim Lebedev 2015-05-22 02:00:00 -04:00
Родитель a5da22720c
Коммит 85a9efdf00
2 изменённых файлов: 18 добавлений и 10 удалений

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

@ -580,6 +580,15 @@ EventStateManager::PreHandleEvent(nsPresContext* aPresContext,
}
break;
}
case NS_MOUSE_ENTER_WIDGET:
// In some cases on e10s NS_MOUSE_ENTER_WIDGET
// event was sent twice into child process of content.
// (From specific widget code (sending is not permanent) and
// from ESM::DispatchMouseOrPointerEvent (sending is permanent)).
// Flag mNoCrossProcessBoundaryForwarding helps to
// suppress sending accidental event from widget code.
aEvent->mFlags.mNoCrossProcessBoundaryForwarding = true;
break;
case NS_MOUSE_EXIT_WIDGET:
// If this is a remote frame, we receive NS_MOUSE_EXIT_WIDGET from the parent
// the mouse exits our content. Since the parent may update the cursor
@ -592,6 +601,10 @@ EventStateManager::PreHandleEvent(nsPresContext* aPresContext,
ClearCachedWidgetCursor(mCurrentTarget);
}
// Flag helps to suppress double event sending into process of content.
// For more information see comment above, at NS_MOUSE_ENTER_WIDGET case.
aEvent->mFlags.mNoCrossProcessBoundaryForwarding = true;
// If the event is not a top-level window exit, then it's not
// really an exit --- we may have traversed widget boundaries but
// we're still in our toplevel window.
@ -1183,7 +1196,6 @@ CrossProcessSafeEvent(const WidgetEvent& aEvent)
case NS_CONTEXTMENU:
case NS_MOUSE_ENTER_WIDGET:
case NS_MOUSE_EXIT_WIDGET:
case NS_MOUSE_OVER:
return true;
default:
return false;

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

@ -1226,25 +1226,21 @@ bool TabParent::SendRealMouseEvent(WidgetMouseEvent& event)
nsCOMPtr<nsIWidget> widget = GetWidget();
if (widget) {
// When we mouseenter the tab, the tab's cursor should become the current
// cursor. When we mouseexit, we stop.
if (event.message == NS_MOUSE_ENTER_WIDGET ||
event.message == NS_MOUSE_OVER) {
// When we mouseenter the tab, the tab's cursor should
// become the current cursor. When we mouseexit, we stop.
if (NS_MOUSE_ENTER_WIDGET == event.message) {
mTabSetsCursor = true;
if (mCustomCursor) {
widget->SetCursor(mCustomCursor, mCustomCursorHotspotX, mCustomCursorHotspotY);
} else if (mCursor != nsCursor(-1)) {
widget->SetCursor(mCursor);
}
// We don't actually want to forward NS_MOUSE_ENTER_WIDGET messages.
return true;
} else if (event.message == NS_MOUSE_EXIT_WIDGET ||
event.message == NS_MOUSE_OUT) {
} else if (NS_MOUSE_EXIT_WIDGET == event.message) {
mTabSetsCursor = false;
}
}
if (event.message == NS_MOUSE_MOVE) {
if (NS_MOUSE_MOVE == event.message) {
return SendRealMouseMoveEvent(event);
}
return SendRealMouseButtonEvent(event);