Fix for full page mouse down being broken bug 75582 patch by bnesse r=peterl sr=attinasi a=asa

This commit is contained in:
peterlubczynski%netscape.com 2001-06-12 04:27:08 +00:00
parent 59c9314898
commit bb749d670f
2 changed files with 36 additions and 14 deletions

View File

@ -490,15 +490,26 @@ HandlePluginEvent(nsGUIEvent *aEvent)
if (aEvent == nsnull || aEvent->widget == nsnull) //null pointer check
return nsEventStatus_eIgnore;
#ifdef XP_WIN
// on Windows, the mouse click is converted to an NS_PLUGIN_ACTIVATE
if( aEvent->message == NS_PLUGIN_ACTIVATE)
(nsIWidget*)(aEvent->widget)->SetFocus(); // send focus to child window
#ifdef XP_MAC // on Mac, we store a pointer to this class as native data in the widget
PluginViewerImpl * pluginViewer;
(nsIWidget*)(aEvent->widget)->GetClientData((PluginViewerImpl *)pluginViewer);
if (pluginViewer != nsnull && pluginViewer->mOwner != nsnull)
return pluginViewer->mOwner->ProcessEvent(*aEvent);
#endif
#else
// the Mac, and presumably others, send NS_MOUSE_ACTIVATE
if (aEvent->message == NS_MOUSE_ACTIVATE) {
(nsIWidget*)(aEvent->widget)->SetFocus(); // send focus to child window
#ifdef XP_MAC
// furthermore on the Mac nsMacEventHandler sends the NS_PLUGIN_ACTIVATE
// followed by the mouse down event, so we need to handle this
} else {
// on Mac, we store a pointer to this class as native data in the widget
PluginViewerImpl * pluginViewer;
(nsIWidget*)(aEvent->widget)->GetClientData((PluginViewerImpl *)pluginViewer);
if (pluginViewer != nsnull && pluginViewer->mOwner != nsnull)
return pluginViewer->mOwner->ProcessEvent(*aEvent);
#endif // XP_MAC
}
#endif // else XP_WIN
return nsEventStatus_eIgnore;
}

View File

@ -490,15 +490,26 @@ HandlePluginEvent(nsGUIEvent *aEvent)
if (aEvent == nsnull || aEvent->widget == nsnull) //null pointer check
return nsEventStatus_eIgnore;
#ifdef XP_WIN
// on Windows, the mouse click is converted to an NS_PLUGIN_ACTIVATE
if( aEvent->message == NS_PLUGIN_ACTIVATE)
(nsIWidget*)(aEvent->widget)->SetFocus(); // send focus to child window
#ifdef XP_MAC // on Mac, we store a pointer to this class as native data in the widget
PluginViewerImpl * pluginViewer;
(nsIWidget*)(aEvent->widget)->GetClientData((PluginViewerImpl *)pluginViewer);
if (pluginViewer != nsnull && pluginViewer->mOwner != nsnull)
return pluginViewer->mOwner->ProcessEvent(*aEvent);
#endif
#else
// the Mac, and presumably others, send NS_MOUSE_ACTIVATE
if (aEvent->message == NS_MOUSE_ACTIVATE) {
(nsIWidget*)(aEvent->widget)->SetFocus(); // send focus to child window
#ifdef XP_MAC
// furthermore on the Mac nsMacEventHandler sends the NS_PLUGIN_ACTIVATE
// followed by the mouse down event, so we need to handle this
} else {
// on Mac, we store a pointer to this class as native data in the widget
PluginViewerImpl * pluginViewer;
(nsIWidget*)(aEvent->widget)->GetClientData((PluginViewerImpl *)pluginViewer);
if (pluginViewer != nsnull && pluginViewer->mOwner != nsnull)
return pluginViewer->mOwner->ProcessEvent(*aEvent);
#endif // XP_MAC
}
#endif // else XP_WIN
return nsEventStatus_eIgnore;
}