Fix performance on MacOS, Chrome & external screen (#2104)
* Fix performance on MacOS, Chrome & external screen * Undo dev logging, tidy up
This commit is contained in:
parent
ad1653ec3f
commit
bbbf152c62
|
@ -367,3 +367,17 @@ select option {
|
||||||
background-color: darken(themed('inputBackgroundColor'), +1);
|
background-color: darken(themed('inputBackgroundColor'), +1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Workaround for slow performance on external monitors on Chrome + MacOS
|
||||||
|
// See: https://bugs.chromium.org/p/chromium/issues/detail?id=971701#c64
|
||||||
|
@keyframes redraw {
|
||||||
|
0% {
|
||||||
|
opacity: 0.99;
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
html.force_redraw {
|
||||||
|
animation: redraw 1s linear infinite;
|
||||||
|
}
|
||||||
|
|
|
@ -76,9 +76,9 @@ const isPrivateMode = BrowserApi.getBackgroundPage() == null;
|
||||||
|
|
||||||
const stateService = new StateService();
|
const stateService = new StateService();
|
||||||
const messagingService = new BrowserMessagingService();
|
const messagingService = new BrowserMessagingService();
|
||||||
|
const logService = getBgService<ConsoleLogService>('logService')();
|
||||||
const searchService = isPrivateMode ? null : new PopupSearchService(getBgService<SearchService>('searchService')(),
|
const searchService = isPrivateMode ? null : new PopupSearchService(getBgService<SearchService>('searchService')(),
|
||||||
getBgService<CipherService>('cipherService')(), getBgService<ConsoleLogService>('consoleLogService')(),
|
getBgService<CipherService>('cipherService')(), logService, getBgService<I18nService>('i18nService')());
|
||||||
getBgService<I18nService>('i18nService')());
|
|
||||||
|
|
||||||
export function initFactory(platformUtilsService: PlatformUtilsService, i18nService: I18nService, storageService: StorageService,
|
export function initFactory(platformUtilsService: PlatformUtilsService, i18nService: I18nService, storageService: StorageService,
|
||||||
popupUtilsService: PopupUtilsService): Function {
|
popupUtilsService: PopupUtilsService): Function {
|
||||||
|
@ -109,6 +109,19 @@ export function initFactory(platformUtilsService: PlatformUtilsService, i18nServ
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
htmlEl.classList.add('locale_' + i18nService.translationLocale);
|
htmlEl.classList.add('locale_' + i18nService.translationLocale);
|
||||||
|
|
||||||
|
// Workaround for slow performance on external monitors on Chrome + MacOS
|
||||||
|
// See: https://bugs.chromium.org/p/chromium/issues/detail?id=971701#c64
|
||||||
|
if (platformUtilsService.isChrome() &&
|
||||||
|
navigator.platform.indexOf('Mac') > -1 &&
|
||||||
|
popupUtilsService.inPopup(window) &&
|
||||||
|
(window.screenLeft < 0 ||
|
||||||
|
window.screenTop < 0 ||
|
||||||
|
window.screenLeft > window.screen.width ||
|
||||||
|
window.screenTop > window.screen.height)) {
|
||||||
|
htmlEl.classList.add('force_redraw');
|
||||||
|
logService.info('Force redraw is on');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue