зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1222662 - In the content process, detect when the mouse exists a plugin frame and update the content cursor accordingly. r=enn
This commit is contained in:
Родитель
6f3da5cd48
Коммит
d44b0e2442
|
@ -288,6 +288,7 @@ EventStateManager::DeltaAccumulator*
|
|||
|
||||
EventStateManager::EventStateManager()
|
||||
: mLockCursor(0)
|
||||
, mLastFrameConsumedSetCursor(false)
|
||||
, mPreLockPoint(0,0)
|
||||
, mCurrentTarget(nullptr)
|
||||
// init d&d gesture state machine variables
|
||||
|
@ -3527,8 +3528,19 @@ EventStateManager::UpdateCursor(nsPresContext* aPresContext,
|
|||
nsIFrame::Cursor framecursor;
|
||||
nsPoint pt = nsLayoutUtils::GetEventCoordinatesRelativeTo(aEvent,
|
||||
aTargetFrame);
|
||||
if (NS_FAILED(aTargetFrame->GetCursor(pt, framecursor)))
|
||||
return; // don't update the cursor if we failed to get it from the frame see bug 118877
|
||||
// Avoid setting cursor when the mouse is over a windowless pluign.
|
||||
if (NS_FAILED(aTargetFrame->GetCursor(pt, framecursor))) {
|
||||
if (XRE_IsContentProcess()) {
|
||||
mLastFrameConsumedSetCursor = true;
|
||||
}
|
||||
return;
|
||||
}
|
||||
// Make sure cursors get reset after the mouse leaves a
|
||||
// windowless plugin frame.
|
||||
if (mLastFrameConsumedSetCursor) {
|
||||
ClearCachedWidgetCursor(aTargetFrame);
|
||||
mLastFrameConsumedSetCursor = false;
|
||||
}
|
||||
cursor = framecursor.mCursor;
|
||||
container = framecursor.mContainer;
|
||||
haveHotspot = framecursor.mHaveHotspot;
|
||||
|
|
|
@ -861,6 +861,7 @@ private:
|
|||
bool dispatchedToContentProcess);
|
||||
|
||||
int32_t mLockCursor;
|
||||
bool mLastFrameConsumedSetCursor;
|
||||
|
||||
// Last mouse event refPoint (the offset from the widget's origin in
|
||||
// device pixels) when mouse was locked, used to restore mouse position
|
||||
|
|
Загрузка…
Ссылка в новой задаче