mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-27 06:43:32 +00:00
Fix for full-page plugins on Mac not passing the right origin during resize because we weren't calculating the widget offset. Bug 120168 r=bneese sr=beard
This commit is contained in:
parent
d84a792769
commit
0db291e301
@ -169,9 +169,10 @@ private:
|
||||
nsCOMPtr<nsITimer> mPluginTimer;
|
||||
};
|
||||
|
||||
#ifdef XP_MAC
|
||||
static void GetWidgetPosAndClip(nsIWidget* aWidget,nscoord& aAbsX, nscoord& aAbsY,
|
||||
nsRect& aClipRect);
|
||||
|
||||
nsRect& aClipRect);
|
||||
#endif
|
||||
|
||||
class PluginViewerImpl : public nsIPluginViewer,
|
||||
public nsIContentViewer,
|
||||
@ -622,6 +623,9 @@ PluginViewerImpl::SetBounds(const nsRect& aBounds)
|
||||
win->clipRect.bottom = aBounds.YMost();
|
||||
win->clipRect.right = aBounds.XMost();
|
||||
|
||||
#ifdef XP_MAC // On Mac we also need to add in the widget offset to the plugin window
|
||||
mOwner->FixUpPluginWindow();
|
||||
#endif
|
||||
inst->SetWindow(win);
|
||||
}
|
||||
NS_RELEASE(inst);
|
||||
@ -647,6 +651,9 @@ PluginViewerImpl::Move(PRInt32 aX, PRInt32 aY)
|
||||
win->clipRect.top = aY;
|
||||
win->clipRect.left = aX;
|
||||
|
||||
#ifdef XP_MAC // On Mac we also need to add in the widget offset to the plugin window
|
||||
mOwner->FixUpPluginWindow();
|
||||
#endif
|
||||
inst->SetWindow(win);
|
||||
}
|
||||
NS_RELEASE(inst);
|
||||
@ -1306,24 +1313,7 @@ nsEventStatus pluginInstanceOwner::ProcessEvent(const nsGUIEvent& anEvent)
|
||||
nsPluginPort* pluginPort = GetPluginPort();
|
||||
// Add in child windows absolute position to get make the dirty rect
|
||||
// relative to the top-level window.
|
||||
nscoord absWidgetX = 0;
|
||||
nscoord absWidgetY = 0;
|
||||
nsRect widgetClip(0,0,0,0);
|
||||
GetWidgetPosAndClip(mWindow,absWidgetX,absWidgetY,widgetClip);
|
||||
//mViewer->GetBounds(widgetClip);
|
||||
//absWidgetX = widgetClip.x;
|
||||
//absWidgetY = widgetClip.y;
|
||||
|
||||
// set the port
|
||||
mPluginWindow.x = absWidgetX;
|
||||
mPluginWindow.y = absWidgetY;
|
||||
|
||||
|
||||
// fix up the clipping region
|
||||
mPluginWindow.clipRect.top = widgetClip.y;
|
||||
mPluginWindow.clipRect.left = widgetClip.x;
|
||||
mPluginWindow.clipRect.bottom = mPluginWindow.clipRect.top + widgetClip.height;
|
||||
mPluginWindow.clipRect.right = mPluginWindow.clipRect.left + widgetClip.width;
|
||||
FixUpPluginWindow();
|
||||
|
||||
EventRecord updateEvent;
|
||||
InitializeEventRecord(&updateEvent);
|
||||
@ -1337,7 +1327,6 @@ nsEventStatus pluginInstanceOwner::ProcessEvent(const nsGUIEvent& anEvent)
|
||||
return nsEventStatus_eConsumeNoDefault;
|
||||
|
||||
}
|
||||
//nsPluginPort* port = (nsPluginPort*)mWidget->GetNativeData(NS_NATIVE_PLUGIN_PORT);
|
||||
nsPluginPort* port = (nsPluginPort*)mWindow->GetNativeData(NS_NATIVE_PLUGIN_PORT);
|
||||
nsPluginEvent pluginEvent = { event, nsPluginPlatformWindowRef(port->port) };
|
||||
PRBool eventHandled = PR_FALSE;
|
||||
|
Loading…
Reference in New Issue
Block a user