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
Change the PuppetWidget from defining screen coordinates from tab-content-relative to being based on actual screen geometry. PuppetWidgets can have position. In the parent process, the widget has a position and a separate client position (that includes OS window chrome... on Linux and Windows as others have no chrome). In the child process, the widget (non-origin) position, whose calculation compensates for the OS window decoration.
This commit is contained in:
parent
c75eab55ac
commit
75b7fa4b98
@ -2051,7 +2051,7 @@ TabChild::RecvUpdateDimensions(const nsIntRect& rect, const nsIntSize& size,
|
|||||||
ScreenIntSize oldScreenSize = mInnerSize;
|
ScreenIntSize oldScreenSize = mInnerSize;
|
||||||
mInnerSize = ScreenIntSize::FromUnknownSize(
|
mInnerSize = ScreenIntSize::FromUnknownSize(
|
||||||
gfx::IntSize(size.width, size.height));
|
gfx::IntSize(size.width, size.height));
|
||||||
mWidget->Resize(0, 0, size.width, size.height,
|
mWidget->Resize(rect.x + chromeDisp.x, rect.y + chromeDisp.y, size.width, size.height,
|
||||||
true);
|
true);
|
||||||
|
|
||||||
nsCOMPtr<nsIBaseWindow> baseWin = do_QueryInterface(WebNavigation());
|
nsCOMPtr<nsIBaseWindow> baseWin = do_QueryInterface(WebNavigation());
|
||||||
|
@ -896,8 +896,15 @@ TabParent::UpdateDimensions(const nsIntRect& rect, const nsIntSize& size)
|
|||||||
|
|
||||||
if (!mUpdatedDimensions || mOrientation != orientation ||
|
if (!mUpdatedDimensions || mOrientation != orientation ||
|
||||||
mDimensions != size || !mRect.IsEqualEdges(rect)) {
|
mDimensions != size || !mRect.IsEqualEdges(rect)) {
|
||||||
|
nsCOMPtr<nsIWidget> widget = GetWidget();
|
||||||
|
nsIntRect contentRect = rect;
|
||||||
|
if (widget) {
|
||||||
|
contentRect.x += widget->GetClientOffset().x;
|
||||||
|
contentRect.y += widget->GetClientOffset().y;
|
||||||
|
}
|
||||||
|
|
||||||
mUpdatedDimensions = true;
|
mUpdatedDimensions = true;
|
||||||
mRect = rect;
|
mRect = contentRect;
|
||||||
mDimensions = size;
|
mDimensions = size;
|
||||||
mOrientation = orientation;
|
mOrientation = orientation;
|
||||||
|
|
||||||
|
@ -960,6 +960,13 @@ PuppetWidget::GetWindowPosition()
|
|||||||
return nsIntPoint(winX, winY);
|
return nsIntPoint(winX, winY);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NS_METHOD
|
||||||
|
PuppetWidget::GetScreenBounds(nsIntRect &aRect) {
|
||||||
|
aRect.MoveTo(WidgetToScreenOffset());
|
||||||
|
aRect.SizeTo(mBounds.Size());
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
PuppetScreen::PuppetScreen(void *nativeScreen)
|
PuppetScreen::PuppetScreen(void *nativeScreen)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -92,8 +92,14 @@ public:
|
|||||||
double aWidth,
|
double aWidth,
|
||||||
double aHeight,
|
double aHeight,
|
||||||
bool aRepaint) MOZ_OVERRIDE
|
bool aRepaint) MOZ_OVERRIDE
|
||||||
// Widget position is controlled by the parent process via TabChild.
|
{
|
||||||
{ return Resize(aWidth, aHeight, aRepaint); }
|
if (mBounds.x != aX || mBounds.y != aY) {
|
||||||
|
NotifyWindowMoved(aX, aY);
|
||||||
|
}
|
||||||
|
mBounds.x = aX;
|
||||||
|
mBounds.y = aY;
|
||||||
|
return Resize(aWidth, aHeight, aRepaint);
|
||||||
|
}
|
||||||
|
|
||||||
// XXX/cjones: copying gtk behavior here; unclear what disabling a
|
// XXX/cjones: copying gtk behavior here; unclear what disabling a
|
||||||
// widget is supposed to entail
|
// widget is supposed to entail
|
||||||
@ -197,6 +203,8 @@ public:
|
|||||||
// Get the screen position of the application window.
|
// Get the screen position of the application window.
|
||||||
nsIntPoint GetWindowPosition();
|
nsIntPoint GetWindowPosition();
|
||||||
|
|
||||||
|
NS_IMETHOD GetScreenBounds(nsIntRect &aRect) MOZ_OVERRIDE;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool mEnabled;
|
bool mEnabled;
|
||||||
bool mVisible;
|
bool mVisible;
|
||||||
|
Loading…
Reference in New Issue
Block a user