mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1208944 - Part 10-a. Call CallWindowProc when WidgetPluginEvent isn't handled by plugin. r=masayuki
This commit is contained in:
parent
b27d1a5baf
commit
3317a4cbfe
@ -286,6 +286,11 @@ parent:
|
||||
*/
|
||||
async SetCandidateWindowForPlugin(int32_t aX, int32_t aY);
|
||||
|
||||
/**
|
||||
* When plugin event isn't consumed, call this
|
||||
*/
|
||||
async DefaultProcOfPluginEvent(WidgetPluginEvent aEvent);
|
||||
|
||||
/**
|
||||
* Request that the parent process move focus to the browser's frame. If
|
||||
* canRaise is true, the window can be raised if it is inactive.
|
||||
|
@ -1948,8 +1948,11 @@ TabChild::RecvPluginEvent(const WidgetPluginEvent& aEvent)
|
||||
{
|
||||
WidgetPluginEvent localEvent(aEvent);
|
||||
localEvent.widget = mPuppetWidget;
|
||||
APZCCallbackHelper::DispatchWidgetEvent(localEvent);
|
||||
// XXX If not consumed, we should call default action (ex. DefWindowProc)?
|
||||
nsEventStatus status = APZCCallbackHelper::DispatchWidgetEvent(localEvent);
|
||||
if (status != nsEventStatus_eConsumeNoDefault) {
|
||||
// If not consumed, we should call default action
|
||||
SendDefaultProcOfPluginEvent(aEvent);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -2409,6 +2409,18 @@ TabParent::RecvSetCandidateWindowForPlugin(const int32_t& aX,
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
TabParent::RecvDefaultProcOfPluginEvent(const WidgetPluginEvent& aEvent)
|
||||
{
|
||||
nsCOMPtr<nsIWidget> widget = GetWidget();
|
||||
if (!widget) {
|
||||
return true;
|
||||
}
|
||||
|
||||
widget->DefaultProcOfPluginEvent(aEvent);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
TabParent::RecvGetInputContext(int32_t* aIMEEnabled,
|
||||
int32_t* aIMEOpen)
|
||||
|
@ -198,6 +198,8 @@ public:
|
||||
virtual bool RecvSetPluginFocused(const bool& aFocused) override;
|
||||
virtual bool RecvSetCandidateWindowForPlugin(const int32_t& aX,
|
||||
const int32_t& aY) override;
|
||||
virtual bool RecvDefaultProcOfPluginEvent(
|
||||
const WidgetPluginEvent& aEvent) override;
|
||||
virtual bool RecvGetInputContext(int32_t* aIMEEnabled,
|
||||
int32_t* aIMEOpen) override;
|
||||
virtual bool RecvSetInputContext(const int32_t& aIMEEnabled,
|
||||
|
@ -687,6 +687,15 @@ PuppetWidget::SetPluginFocused(bool& aFocused)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void
|
||||
PuppetWidget::DefaultProcOfPluginEvent(const WidgetPluginEvent& aEvent)
|
||||
{
|
||||
if (!mTabChild) {
|
||||
return;
|
||||
}
|
||||
mTabChild->SendDefaultProcOfPluginEvent(aEvent);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP_(void)
|
||||
PuppetWidget::SetInputContext(const InputContext& aContext,
|
||||
const InputContextAction& aAction)
|
||||
|
@ -220,6 +220,8 @@ public:
|
||||
nsString& aCommitted) override;
|
||||
|
||||
NS_IMETHOD SetPluginFocused(bool& aFocused) override;
|
||||
virtual void DefaultProcOfPluginEvent(
|
||||
const mozilla::WidgetPluginEvent& aEvent) override;
|
||||
|
||||
virtual nsresult SynthesizeNativeKeyEvent(int32_t aNativeKeyboardLayout,
|
||||
int32_t aNativeKeyCode,
|
||||
|
@ -220,6 +220,9 @@ public:
|
||||
virtual void SetCandidateWindowForPlugin(int32_t aX,
|
||||
int32_t aY) override
|
||||
{ }
|
||||
virtual void DefaultProcOfPluginEvent(
|
||||
const mozilla::WidgetPluginEvent& aEvent) override
|
||||
{ }
|
||||
NS_IMETHOD AttachNativeKeyEvent(mozilla::WidgetKeyboardEvent& aEvent) override { return NS_ERROR_NOT_IMPLEMENTED; }
|
||||
NS_IMETHOD_(bool) ExecuteNativeKeyBinding(
|
||||
NativeKeyBindingsType aType,
|
||||
|
@ -133,8 +133,8 @@ typedef void* nsNativeWidget;
|
||||
#endif
|
||||
|
||||
#define NS_IWIDGET_IID \
|
||||
{ 0xa3db64d2, 0x5a73, 0x425f, \
|
||||
{ 0x9b, 0xb0, 0x57, 0x7f, 0xe5, 0x56, 0x43, 0x15 } }
|
||||
{ 0x73c0a475, 0x450f, 0x4202, \
|
||||
{ 0xab, 0xb4, 0x62, 0xf8, 0x9d, 0xbe, 0xf7, 0x9a } }
|
||||
|
||||
/*
|
||||
* Window shadow styles
|
||||
@ -1804,6 +1804,12 @@ public:
|
||||
*/
|
||||
virtual void SetCandidateWindowForPlugin(int32_t aX, int32_t aY) = 0;
|
||||
|
||||
/**
|
||||
* Handle default action when PluginEvent isn't handled
|
||||
*/
|
||||
virtual void DefaultProcOfPluginEvent(
|
||||
const mozilla::WidgetPluginEvent& aEvent) = 0;
|
||||
|
||||
/*
|
||||
* Notifies the input context changes.
|
||||
*/
|
||||
|
@ -7763,6 +7763,24 @@ nsWindow::SetCandidateWindowForPlugin(int32_t aX, int32_t aY)
|
||||
IMEHandler::SetCandidateWindow(this, &form);
|
||||
}
|
||||
|
||||
void
|
||||
nsWindow::DefaultProcOfPluginEvent(const WidgetPluginEvent& aEvent)
|
||||
{
|
||||
const NPEvent* pPluginEvent =
|
||||
static_cast<const NPEvent*>(aEvent.mPluginEvent);
|
||||
|
||||
if (NS_WARN_IF(!pPluginEvent)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!mWnd) {
|
||||
return;
|
||||
}
|
||||
|
||||
CallWindowProcW(GetPrevWindowProc(), mWnd, pPluginEvent->event,
|
||||
pPluginEvent->wParam, pPluginEvent->lParam);
|
||||
}
|
||||
|
||||
/**************************************************************
|
||||
**************************************************************
|
||||
**
|
||||
|
@ -299,6 +299,8 @@ public:
|
||||
|
||||
virtual void SetCandidateWindowForPlugin(int32_t aX,
|
||||
int32_t aY) override;
|
||||
virtual void DefaultProcOfPluginEvent(
|
||||
const mozilla::WidgetPluginEvent& aEvent) override;
|
||||
|
||||
protected:
|
||||
virtual ~nsWindow();
|
||||
|
Loading…
Reference in New Issue
Block a user