mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-18 21:45:31 +09:00
feat(desktop): bundled renderer, modules and instance accounts (#3254)
This commit is contained in:
1 parent
c748c8af4e
commit
7c5fa2180a
1275 files changed
+215074
-81246
No files matched your search
@@ -31,16 +31,6 @@ class Window {
|
||||
|
||||
constructor() {
|
||||
makeAutoObservable(this, {}, {autoBind: true});
|
||||
this.initListeners();
|
||||
}
|
||||
|
||||
private initListeners(): void {
|
||||
window.addEventListener('focus', () => this.setFocused(true));
|
||||
window.addEventListener('blur', () => this.setFocused(false));
|
||||
document.addEventListener('visibilitychange', () => {
|
||||
this.setVisible(!document.hidden);
|
||||
});
|
||||
window.addEventListener('resize', () => this.updateWindowSize());
|
||||
}
|
||||
|
||||
setFocused(focused: boolean): void {
|
||||
@@ -61,8 +51,12 @@ class Window {
|
||||
}
|
||||
|
||||
updateWindowSize(): void {
|
||||
this.windowSize = getWindowSize();
|
||||
logger.debug(`Window resized: ${this.windowSize.width}x${this.windowSize.height}`);
|
||||
const next = getWindowSize();
|
||||
if (next.width === this.windowSize.width && next.height === this.windowSize.height) {
|
||||
return;
|
||||
}
|
||||
this.windowSize = next;
|
||||
logger.debug(`Window resized: ${next.width}x${next.height}`);
|
||||
}
|
||||
|
||||
isFocused(): boolean {
|
||||
|
||||
Reference in new issue
Block a user