mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 445765. In getting the device context from a docshell don't go through nsIBaseWindow::GetMainWidget because that always returns the device context for the primary screen when called on toplevel docshell. r=dbaron
This commit is contained in:
parent
aa2f62e0cd
commit
3ee08e2969
@ -88,6 +88,7 @@
|
||||
#include "imgIRequest.h"
|
||||
#include "imgIContainer.h"
|
||||
#include "nsIImageLoadingContent.h"
|
||||
#include "nsCOMPtr.h"
|
||||
|
||||
#ifdef MOZ_SVG
|
||||
#include "nsSVGUtils.h"
|
||||
@ -3151,13 +3152,13 @@ nsLayoutUtils::GetDeviceContextForScreenInfo(nsIDocShell* aDocShell)
|
||||
|
||||
win->EnsureSizeUpToDate();
|
||||
|
||||
nsCOMPtr<nsIBaseWindow> baseWindow = do_QueryInterface(docShell);
|
||||
NS_ENSURE_TRUE(baseWindow, nsnull);
|
||||
|
||||
nsCOMPtr<nsIWidget> mainWidget;
|
||||
baseWindow->GetMainWidget(getter_AddRefs(mainWidget));
|
||||
if (mainWidget) {
|
||||
return mainWidget->GetDeviceContext();
|
||||
nsRefPtr<nsPresContext> presContext;
|
||||
docShell->GetPresContext(getter_AddRefs(presContext));
|
||||
if (presContext) {
|
||||
nsIDeviceContext* context = presContext->DeviceContext();
|
||||
if (context) {
|
||||
return context;
|
||||
}
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDocShellTreeItem> curItem = do_QueryInterface(docShell);
|
||||
|
Loading…
Reference in New Issue
Block a user