Bug 1851502 - Remove useless calls to NotifyThemeChanged. r=stransky

Font DPI is explicitly observed here already, and it's the only thing
that affects system font sizes:

  https://searchfox.org/mozilla-central/rev/8a1e1397c48c7419533dec707fd86dc2d8bf6bf9/widget/gtk/nsLookAndFeel.cpp#140

I found these because we get an extra notification here, which can slow
down our startup time on Wayland:

  https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/6375

I'll see if there's a reasonable way to work around it, because the
event is posted async so it doesn't seem trivial to distinguish the fake
event from an actually useful change...

Differential Revision: https://phabricator.services.mozilla.com/D187390
This commit is contained in:
Emilio Cobos Álvarez 2023-09-07 13:26:40 +00:00
parent 993da03774
commit 95c77f8243

View file

@ -5290,7 +5290,6 @@ void nsWindow::OnDPIChanged() {
}
mWidgetListener->UIResolutionChanged();
}
NotifyThemeChanged(ThemeChangeKind::StyleAndLayout);
}
void nsWindow::OnCheckResize() { mPendingConfigures++; }
@ -5355,9 +5354,6 @@ void nsWindow::OnScaleChanged(bool aNotify) {
presShell->BackingScaleFactorChanged();
}
}
// This affects style / layout because it affects system font sizes.
// Update menu's font size etc.
NotifyThemeChanged(ThemeChangeKind::StyleAndLayout);
DispatchResized();