mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-03 04:27:41 +00:00
Bug 503791. Make sure that the device context has a widget so that it can determine what screen it is on. r=dbaron
This commit is contained in:
parent
c50a2c3b1f
commit
84ffcd3b7a
@ -2401,10 +2401,15 @@ DocumentViewerImpl::CreateDeviceContext(nsIView* aContainerView)
|
||||
nsIWidget* widget = nsnull;
|
||||
if (aContainerView) {
|
||||
widget = aContainerView->GetNearestWidget(nsnull);
|
||||
if (widget) {
|
||||
widget = widget->GetTopLevelWidget();
|
||||
}
|
||||
}
|
||||
// The device context needs a widget to be able to determine the screen it is on.
|
||||
if (!widget) {
|
||||
widget = mParentWidget;
|
||||
}
|
||||
if (widget) {
|
||||
widget = widget->GetTopLevelWidget();
|
||||
}
|
||||
|
||||
mDeviceContext->Init(widget);
|
||||
return NS_OK;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user