If you don't spend any time on Nightly in Windows 10, please feel free to disregard this.

tl;dr: we're sometimes creating the first window differently than usual, so be on the lookout for breakages.

On 2021-01-05, a change landed in Nightly which enabled the pre-XUL skeleton UI [1]. This is a feature which allows us to create the first window and populate it with a non-interactive placeholder UI before we load xul.dll. On some systems, this can mean we can give visual indication of Firefox launching as much as 15 seconds sooner than normal (loading xul.dll can take a while). We're hoping this could be a big win for users who experience very slow startups, and we also hope it will improve the overall snappiness of startup even on fast systems.

For a number of reasons, though, getting this to work properly was not trivial. We implement it by creating a window very early in startup [2], and then passing its handle off to nsWindow the first time we would otherwise create the first real browser window [3]. We then would like to treat the window handle exactly as if we had just created it, despite the fact that we did not. Discrepancies arise due to, for example, us having already shown the window, meaning the native events associated with doing so have already come through, and we can't process them to set up our state as we normally would.

Accordingly, we do a little dance to try to get our state synced up with how it ought to be if we had just created the window, and we do things a little bit differently when we would normally be showing said window for the first time (because we've actually already shown it). All of this is complexity and things we could get wrong, and it could have consequences on how the window behaves down the line during normal use. For example, in the first iteration of this, we weren't receiving our initial focus event on the browser window, which resulted in the text caret not showing up until closing and reopening the browser [4].

We've done our best to track down and identify all such issues, but it's certainly possible that more could manifest. So please don't hesitate to reach out or file a bug under the meta [5].

Lastly, a big thanks to Emma Malysz who was instrumental in getting this ready to land, to the Windows Widget folks who reviewed it, and to everyone who filed bugs with it during early dogfooding.

Cheers,
dthayer

[1]: https://bugzilla.mozilla.org/show_bug.cgi?id=1680258#c15
[2]: https://searchfox.org/mozilla-central/rev/ef900cd2258d4c5d968093f612f807d96e6e7c98/mozglue/misc/PreXULSkeletonUI.cpp#1933 [3]: https://searchfox.org/mozilla-central/rev/ef900cd2258d4c5d968093f612f807d96e6e7c98/widget/windows/nsWindow.cpp#897
[4]: https://bugzilla.mozilla.org/show_bug.cgi?id=1665456
[5]: https://bugzilla.mozilla.org/show_bug.cgi?id=1665451


_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to