Merge branch 'Vencord:main' into main

This commit is contained in:
Sammie Zhang 2024-05-11 20:03:04 -07:00 committed by GitHub
commit 0a96d9e952
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 7 additions and 2 deletions

View file

@ -53,7 +53,7 @@ If you don't know the difference, pick amd64.
Below you can find unofficial packages created by the community. They are not officially supported by us, so before reporting issues, please first confirm the issue also happens on official builds. When in doubt, consult with their packager first. The flatpak and AppImage should work on any distro that [supports them](https://flatpak.org/setup/), so I recommend you just use those instead! Below you can find unofficial packages created by the community. They are not officially supported by us, so before reporting issues, please first confirm the issue also happens on official builds. When in doubt, consult with their packager first. The flatpak and AppImage should work on any distro that [supports them](https://flatpak.org/setup/), so I recommend you just use those instead!
- Arch Linux: [Vesktop on the Arch user repository](https://aur.archlinux.org/packages?K=vesktop) - Arch Linux: [Vesktop on the Arch user repository](https://aur.archlinux.org/packages?K=vesktop)
- NixOS: https://nixos.wiki/wiki/Discord#Vesktop - NixOS: https://wiki.nixos.org/wiki/Discord#Vesktop
- Windows - Scoop: https://scoop.sh/#/apps?q=Vesktop - Windows - Scoop: https://scoop.sh/#/apps?q=Vesktop
## Building from Source ## Building from Source

View file

@ -12,6 +12,7 @@ import {
Menu, Menu,
MenuItemConstructorOptions, MenuItemConstructorOptions,
nativeTheme, nativeTheme,
screen,
Tray Tray
} from "electron"; } from "electron";
import { rm } from "fs/promises"; import { rm } from "fs/promises";
@ -269,7 +270,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;
} }
@ -317,6 +320,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);

View file

@ -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;