зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1085567 - Fixup synth events within pointer lock implementation for e10s. r=billm
This commit is contained in:
Родитель
26300728c8
Коммит
5ebc9f6da6
|
@ -27,6 +27,7 @@ using class mozilla::gfx::Matrix from "mozilla/gfx/Matrix.h";
|
|||
using struct gfxSize from "gfxPoint.h";
|
||||
using CSSRect from "Units.h";
|
||||
using LayoutDeviceIntRect from "Units.h";
|
||||
using mozilla::LayoutDeviceIntPoint from "Units.h";
|
||||
using ScreenIntSize from "Units.h";
|
||||
using struct mozilla::layers::FrameMetrics from "FrameMetrics.h";
|
||||
using struct mozilla::layers::ScrollableLayerGuid from "FrameMetrics.h";
|
||||
|
@ -332,6 +333,14 @@ parent:
|
|||
|
||||
sync IsParentWindowMainWidgetVisible() returns (bool visible);
|
||||
|
||||
/**
|
||||
* Content process forward from PuppetWidget for synth mouse move
|
||||
* events.
|
||||
*
|
||||
* aPoint a synth point relative to the window
|
||||
*/
|
||||
sync SynthesizeNativeMouseMove(LayoutDeviceIntPoint aPoint);
|
||||
|
||||
/**
|
||||
* Gets the DPI of the screen corresponding to this browser.
|
||||
*/
|
||||
|
|
|
@ -2233,6 +2233,17 @@ TabParent::RecvIsParentWindowMainWidgetVisible(bool* aIsVisible)
|
|||
return NS_SUCCEEDED(rv);
|
||||
}
|
||||
|
||||
bool
|
||||
TabParent::RecvSynthesizeNativeMouseMove(const mozilla::LayoutDeviceIntPoint& aPoint)
|
||||
{
|
||||
// The widget associated with the browser window
|
||||
nsCOMPtr<nsIWidget> widget = GetWidget();
|
||||
if (widget) {
|
||||
widget->SynthesizeNativeMouseMove(aPoint);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
TabParent::RecvGetDPI(float* aValue)
|
||||
{
|
||||
|
|
|
@ -198,6 +198,7 @@ public:
|
|||
virtual bool RecvSetBackgroundColor(const nscolor& aValue) override;
|
||||
virtual bool RecvSetStatus(const uint32_t& aType, const nsString& aStatus) override;
|
||||
virtual bool RecvIsParentWindowMainWidgetVisible(bool* aIsVisible) override;
|
||||
virtual bool RecvSynthesizeNativeMouseMove(const mozilla::LayoutDeviceIntPoint& aPoint) override;
|
||||
virtual bool RecvShowTooltip(const uint32_t& aX, const uint32_t& aY, const nsString& aTooltip) override;
|
||||
virtual bool RecvHideTooltip() override;
|
||||
virtual bool RecvGetDPI(float* aValue) override;
|
||||
|
|
|
@ -854,6 +854,16 @@ PuppetWidget::SetCursor(nsCursor aCursor)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult
|
||||
PuppetWidget::SynthesizeNativeMouseMove(mozilla::LayoutDeviceIntPoint aPoint)
|
||||
{
|
||||
if (mTabChild &&
|
||||
!mTabChild->SendSynthesizeNativeMouseMove(aPoint)) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult
|
||||
PuppetWidget::Paint()
|
||||
{
|
||||
|
|
|
@ -123,13 +123,18 @@ public:
|
|||
NS_IMETHOD ReparentNativeWidget(nsIWidget* aNewParent) override
|
||||
{ return NS_ERROR_UNEXPECTED; }
|
||||
|
||||
// PuppetWidgets don't have any concept of titles.
|
||||
// PuppetWidgets don't have any concept of titles.
|
||||
NS_IMETHOD SetTitle(const nsAString& aTitle) override
|
||||
{ return NS_ERROR_UNEXPECTED; }
|
||||
|
||||
|
||||
virtual mozilla::LayoutDeviceIntPoint WidgetToScreenOffset() override
|
||||
{ return LayoutDeviceIntPoint::FromUntyped(GetWindowPosition() + GetChromeDimensions()); }
|
||||
|
||||
// Synthesized mouse events we need to forwarded to chrome. Event
|
||||
// state manager uses this api to position the mouse in the center
|
||||
// of the window for pointer lock.
|
||||
virtual nsresult SynthesizeNativeMouseMove(mozilla::LayoutDeviceIntPoint aPoint) override;
|
||||
|
||||
void InitEvent(WidgetGUIEvent& aEvent, nsIntPoint* aPoint = nullptr);
|
||||
|
||||
NS_IMETHOD DispatchEvent(WidgetGUIEvent* aEvent, nsEventStatus& aStatus) override;
|
||||
|
|
Загрузка…
Ссылка в новой задаче