Bug 1800992 - Invalidate frame in nsView::WindowResized. r=tnikkel

If all goes well this should also fix bug 1784760...

Differential Revision: https://phabricator.services.mozilla.com/D162773
This commit is contained in:
Emilio Cobos Álvarez 2022-11-23 06:45:41 +00:00
parent 55936f6d6a
commit 2827a17b6f

View File

@ -942,11 +942,17 @@ bool nsView::WindowResized(nsIWidget* aWidget, int32_t aWidth,
// on a non-default-dpi display (bug 829963)
devContext->CheckDPIChange();
int32_t p2a = devContext->AppUnitsPerDevPixel();
if (auto* frame = GetFrame()) {
// Usually the resize would deal with this, but there are some cases (like
// web-extension popups) where frames might already be correctly sized etc
// due to a call to e.g. nsDocumentViewer::GetContentSize or so.
frame->InvalidateFrame();
}
mViewManager->SetWindowDimensions(NSIntPixelsToAppUnits(aWidth, p2a),
NSIntPixelsToAppUnits(aHeight, p2a));
nsXULPopupManager* pm = nsXULPopupManager::GetInstance();
if (pm) {
if (nsXULPopupManager* pm = nsXULPopupManager::GetInstance()) {
PresShell* presShell = mViewManager->GetPresShell();
if (presShell && presShell->GetDocument()) {
pm->AdjustPopupsOnWindowChange(presShell);