mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1075670 - [e10s] event.screenX and event.screenY is wrong
Math for window chrome calculation was off on Linux. Removed redundant, and incorrect, math in favor of other better functions.
This commit is contained in:
parent
68343fa91e
commit
85b40e96f5
@ -914,8 +914,7 @@ nsFrameLoader::ShowRemoteFrame(const nsIntSize& size,
|
||||
|
||||
// Don't show remote iframe if we are waiting for the completion of reflow.
|
||||
if (!aFrame || !(aFrame->GetStateBits() & NS_FRAME_FIRST_REFLOW)) {
|
||||
nsIntPoint chromeDisp = aFrame->GetChromeDisplacement();
|
||||
mRemoteBrowser->UpdateDimensions(dimensions, size, chromeDisp);
|
||||
mRemoteBrowser->UpdateDimensions(dimensions, size);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1960,8 +1959,7 @@ nsFrameLoader::UpdatePositionAndSize(nsSubDocumentFrame *aIFrame)
|
||||
nsIntSize size = aIFrame->GetSubdocumentSize();
|
||||
nsIntRect dimensions;
|
||||
NS_ENSURE_SUCCESS(GetWindowDimensions(dimensions), NS_ERROR_FAILURE);
|
||||
nsIntPoint chromeDisp = aIFrame->GetChromeDisplacement();
|
||||
mRemoteBrowser->UpdateDimensions(dimensions, size, chromeDisp);
|
||||
mRemoteBrowser->UpdateDimensions(dimensions, size);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -885,8 +885,7 @@ TabParent::RecvSetDimensions(const uint32_t& aFlags,
|
||||
}
|
||||
|
||||
void
|
||||
TabParent::UpdateDimensions(const nsIntRect& rect, const nsIntSize& size,
|
||||
const nsIntPoint& aChromeDisp)
|
||||
TabParent::UpdateDimensions(const nsIntRect& rect, const nsIntSize& size)
|
||||
{
|
||||
if (mIsDestroyed) {
|
||||
return;
|
||||
@ -901,9 +900,9 @@ TabParent::UpdateDimensions(const nsIntRect& rect, const nsIntSize& size,
|
||||
mRect = rect;
|
||||
mDimensions = size;
|
||||
mOrientation = orientation;
|
||||
mChromeDisp = aChromeDisp;
|
||||
|
||||
unused << SendUpdateDimensions(mRect, mDimensions, mOrientation, mChromeDisp);
|
||||
nsIntPoint chromeOffset = -GetChildProcessOffset();
|
||||
unused << SendUpdateDimensions(mRect, mDimensions, mOrientation, chromeOffset);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2681,7 +2680,7 @@ TabParent::HandleEvent(nsIDOMEvent* aEvent)
|
||||
}
|
||||
nsIntRect windowDims;
|
||||
NS_ENSURE_SUCCESS(frameLoader->GetWindowDimensions(windowDims), NS_ERROR_FAILURE);
|
||||
UpdateDimensions(windowDims, mDimensions, mChromeDisp);
|
||||
UpdateDimensions(windowDims, mDimensions);
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_OK;
|
||||
|
@ -241,8 +241,7 @@ public:
|
||||
// message-sending functions under a layer of indirection and
|
||||
// eating the return values
|
||||
void Show(const nsIntSize& size, bool aParentIsActive);
|
||||
void UpdateDimensions(const nsIntRect& rect, const nsIntSize& size,
|
||||
const nsIntPoint& chromeDisp);
|
||||
void UpdateDimensions(const nsIntRect& rect, const nsIntSize& size);
|
||||
void UpdateFrame(const layers::FrameMetrics& aFrameMetrics);
|
||||
void UIResolutionChanged();
|
||||
void AcknowledgeScrollUpdate(const ViewID& aScrollId, const uint32_t& aScrollGeneration);
|
||||
@ -434,7 +433,6 @@ protected:
|
||||
nsIntRect mRect;
|
||||
nsIntSize mDimensions;
|
||||
ScreenOrientation mOrientation;
|
||||
nsIntPoint mChromeDisp;
|
||||
float mDPI;
|
||||
CSSToLayoutDeviceScale mDefaultScale;
|
||||
bool mShown;
|
||||
|
@ -1274,24 +1274,3 @@ nsSubDocumentFrame::ObtainIntrinsicSizeFrame()
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
nsIntPoint
|
||||
nsSubDocumentFrame::GetChromeDisplacement()
|
||||
{
|
||||
nsIFrame* nextFrame = nsLayoutUtils::GetCrossDocParentFrame(this);
|
||||
if (!nextFrame) {
|
||||
NS_WARNING("Couldn't find window chrome to calculate displacement to.");
|
||||
return nsIntPoint();
|
||||
}
|
||||
|
||||
nsIFrame* rootFrame = nextFrame;
|
||||
while (nextFrame) {
|
||||
rootFrame = nextFrame;
|
||||
nextFrame = nsLayoutUtils::GetCrossDocParentFrame(rootFrame);
|
||||
}
|
||||
|
||||
nsPoint offset = GetOffsetToCrossDoc(rootFrame);
|
||||
int32_t appUnitsPerDevPixel = rootFrame->PresContext()->AppUnitsPerDevPixel();
|
||||
return nsIntPoint((int)(offset.x/appUnitsPerDevPixel),
|
||||
(int)(offset.y/appUnitsPerDevPixel));
|
||||
}
|
||||
|
@ -127,8 +127,6 @@ public:
|
||||
*/
|
||||
bool PassPointerEventsToChildren();
|
||||
|
||||
nsIntPoint GetChromeDisplacement();
|
||||
|
||||
protected:
|
||||
friend class AsyncFrameInit;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user