Bug 1696556 - Always run earlyBlankFirstPaint if we showed skele UI r=emalysz

This code is important for transitioning between the skeleton UI code and the
full-featured browser window code. Additionally, the original logic of disabling
when not on the default theme no longer applies, because it was intended to
eliminate white flashes in dark mode. However, with the skeleton UI, those
white flashes no longer occur.

Differential Revision: https://phabricator.services.mozilla.com/D107293
This commit is contained in:
Doug Thayer 2021-03-09 18:37:53 +00:00
Родитель bf39b3bc8e
Коммит 6a24f1709b
5 изменённых файлов: 24 добавлений и 0 удалений

Просмотреть файл

@ -762,6 +762,7 @@ let JSWINDOWACTORS = {
// Until bug 1450626 and bug 1488384 are fixed, skip the blank window when
// using a non-default theme.
if (
!Services.startup.showedPreXULSkeletonUI &&
Services.prefs.getCharPref(
"extensions.activeThemeID",
"default-theme@mozilla.org"

Просмотреть файл

@ -96,6 +96,7 @@ static const wchar_t kPreXULSkeletonUIKeyPath[] =
L"SOFTWARE"
L"\\" MOZ_APP_VENDOR L"\\" MOZ_APP_BASENAME L"\\PreXULSkeletonUISettings";
static bool sPreXULSkeletonUIShown = false;
static bool sPreXULSkeletonUIEnabled = false;
static HWND sPreXULSkeletonUIWindow;
static LPWSTR const gStockApplicationIcon = MAKEINTRESOURCEW(32512);
@ -2078,6 +2079,10 @@ void CreateAndStorePreXULSkeletonUI(HINSTANCE hInstance, int argc,
bool WasPreXULSkeletonUIMaximized() { return sMaximized; }
bool GetPreXULSkeletonUIWasShown() {
return sPreXULSkeletonUIShown || !!sPreXULSkeletonUIWindow;
}
HWND ConsumePreXULSkeletonUIHandle() {
// NOTE: we need to make sure that everything that runs here is a no-op if
// it failed to be set, which is a possibility. If anything fails to be set

Просмотреть файл

@ -157,6 +157,7 @@ enum class PreXULSkeletonUIProgress : uint32_t {
MFBT_API void CreateAndStorePreXULSkeletonUI(HINSTANCE hInstance, int argc,
char** argv);
MFBT_API bool GetPreXULSkeletonUIWasShown();
MFBT_API HWND ConsumePreXULSkeletonUIHandle();
MFBT_API Maybe<PreXULSkeletonUIError> GetPreXULSkeletonUIErrorReason();
MFBT_API bool WasPreXULSkeletonUIMaximized();

Просмотреть файл

@ -64,6 +64,8 @@ static NS_DEFINE_CID(kAppShellCID, NS_APPSHELL_CID);
#define kNanosecondsPerSecond 1000000000.0
#if defined(XP_WIN)
# include "mozilla/PreXULSkeletonUI.h"
# include "mozilla/perfprobe.h"
/**
* Events sent to the system for profiling purposes
@ -579,6 +581,16 @@ nsAppStartup::GetSecondsSinceLastOSRestart(int64_t* aResult) {
#endif
}
NS_IMETHODIMP
nsAppStartup::GetShowedPreXULSkeletonUI(bool* aResult) {
#if defined(XP_WIN)
*aResult = GetPreXULSkeletonUIWasShown();
#else
*aResult = false;
#endif
return NS_OK;
}
NS_IMETHODIMP
nsAppStartup::SetInterrupted(bool aInterrupted) {
mInterrupted = aInterrupted;

Просмотреть файл

@ -170,6 +170,11 @@ interface nsIAppStartup : nsISupports
*/
readonly attribute int64_t secondsSinceLastOSRestart;
/**
* Whether or not we showed the startup skeleton UI.
*/
readonly attribute bool showedPreXULSkeletonUI;
/**
* Returns an object with main, process, firstPaint, sessionRestored properties.
* Properties may not be available depending on platform or application