Bug 1629313 - Part 2 - Avoid setting the desktop background twice for each request on Mac r=smaug

Update the check in the OnStateChange() so that we only attempt to set the background image once.

Differential Revision: https://phabricator.services.mozilla.com/D71427
This commit is contained in:
Haik Aftandilian
2020-04-21 21:58:30 +00:00
parent ccc8fec0cf
commit a91c1a8076

View File

@@ -201,7 +201,8 @@ NS_IMETHODIMP
nsMacShellService::OnStateChange(nsIWebProgress* aWebProgress,
nsIRequest* aRequest, uint32_t aStateFlags,
nsresult aStatus) {
if (aStateFlags & STATE_STOP) {
if (NS_SUCCEEDED(aStatus) && (aStateFlags & STATE_STOP) &&
(aRequest == nullptr)) {
nsCOMPtr<nsIObserverService> os(
do_GetService("@mozilla.org/observer-service;1"));
if (os)