mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-14 05:45:37 +00:00
Add an observer service notification for the first widget paint message. (bug 1173117 part 2, r=roc)
This commit is contained in:
parent
5035751346
commit
127048bb86
@ -806,6 +806,7 @@ PresShell::PresShell()
|
||||
mPaintingIsFrozen = false;
|
||||
mHasCSSBackgroundColor = true;
|
||||
mIsLastChromeOnlyEscapeKeyConsumed = false;
|
||||
mHasReceivedPaintMessage = false;
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS(PresShell, nsIPresShell, nsIDocumentObserver,
|
||||
@ -8560,6 +8561,19 @@ PresShell::DidPaintWindow()
|
||||
// about compositing of popups.
|
||||
return;
|
||||
}
|
||||
|
||||
if (!mHasReceivedPaintMessage) {
|
||||
mHasReceivedPaintMessage = true;
|
||||
|
||||
nsCOMPtr<nsIObserverService> obsvc = services::GetObserverService();
|
||||
if (obsvc && mDocument) {
|
||||
nsPIDOMWindow* window = mDocument->GetWindow();
|
||||
nsCOMPtr<nsIDOMChromeWindow> chromeWin(do_QueryInterface(window));
|
||||
if (chromeWin) {
|
||||
obsvc->NotifyObservers(chromeWin, "widget-first-paint", nullptr);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -881,6 +881,9 @@ protected:
|
||||
// Whether the last chrome-only escape key event is consumed.
|
||||
bool mIsLastChromeOnlyEscapeKeyConsumed : 1;
|
||||
|
||||
// Whether the widget has received a paint message yet.
|
||||
bool mHasReceivedPaintMessage : 1;
|
||||
|
||||
static bool sDisableNonTestMouseEvents;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user