mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Add an observer service notification for the first widget paint message. (bug 1173117 part 2, r=roc)
This commit is contained in:
parent
0cfc1d731a
commit
a944807bc3
@ -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