mirror of
https://github.com/Vencord/Vesktop.git
synced 2025-02-24 14:15:09 +00:00
Merge branch 'Vencord:main' into main
This commit is contained in:
commit
d142180b46
2 changed files with 6 additions and 1 deletions
|
@ -13,6 +13,7 @@ import {
|
||||||
MenuItemConstructorOptions,
|
MenuItemConstructorOptions,
|
||||||
nativeImage,
|
nativeImage,
|
||||||
nativeTheme,
|
nativeTheme,
|
||||||
|
screen,
|
||||||
Tray
|
Tray
|
||||||
} from "electron";
|
} from "electron";
|
||||||
import { rm } from "fs/promises";
|
import { rm } from "fs/promises";
|
||||||
|
@ -278,7 +279,9 @@ function getWindowBoundsOptions(): BrowserWindowConstructorOptions {
|
||||||
height: height ?? DEFAULT_HEIGHT
|
height: height ?? DEFAULT_HEIGHT
|
||||||
} as BrowserWindowConstructorOptions;
|
} as BrowserWindowConstructorOptions;
|
||||||
|
|
||||||
if (x != null && y != null) {
|
const storedDisplay = screen.getAllDisplays().find(display => display.id === State.store.displayid);
|
||||||
|
|
||||||
|
if (x != null && y != null && storedDisplay) {
|
||||||
options.x = x;
|
options.x = x;
|
||||||
options.y = y;
|
options.y = y;
|
||||||
}
|
}
|
||||||
|
@ -326,6 +329,7 @@ function initWindowBoundsListeners(win: BrowserWindow) {
|
||||||
|
|
||||||
const saveBounds = () => {
|
const saveBounds = () => {
|
||||||
State.store.windowBounds = win.getBounds();
|
State.store.windowBounds = win.getBounds();
|
||||||
|
State.store.displayid = screen.getDisplayMatching(State.store.windowBounds).id;
|
||||||
};
|
};
|
||||||
|
|
||||||
win.on("resize", saveBounds);
|
win.on("resize", saveBounds);
|
||||||
|
|
1
src/shared/settings.d.ts
vendored
1
src/shared/settings.d.ts
vendored
|
@ -37,6 +37,7 @@ export interface State {
|
||||||
maximized?: boolean;
|
maximized?: boolean;
|
||||||
minimized?: boolean;
|
minimized?: boolean;
|
||||||
windowBounds?: Rectangle;
|
windowBounds?: Rectangle;
|
||||||
|
displayid: int;
|
||||||
|
|
||||||
skippedUpdate?: string;
|
skippedUpdate?: string;
|
||||||
firstLaunch?: boolean;
|
firstLaunch?: boolean;
|
||||||
|
|
Loading…
Add table
Reference in a new issue