Merge branch 'main' into tray-icon
This commit is contained in:
commit
f2bfba02e0
3 changed files with 7 additions and 2 deletions
|
@ -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!
|
||||
|
||||
- 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
|
||||
|
||||
## Building from Source
|
||||
|
|
|
@ -13,6 +13,7 @@ import {
|
|||
MenuItemConstructorOptions,
|
||||
nativeImage,
|
||||
nativeTheme,
|
||||
screen,
|
||||
Tray
|
||||
} from "electron";
|
||||
import { readFile, rm } from "fs/promises";
|
||||
|
@ -270,7 +271,9 @@ function getWindowBoundsOptions(): BrowserWindowConstructorOptions {
|
|||
height: height ?? DEFAULT_HEIGHT
|
||||
} 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.y = y;
|
||||
}
|
||||
|
@ -318,6 +321,7 @@ function initWindowBoundsListeners(win: BrowserWindow) {
|
|||
|
||||
const saveBounds = () => {
|
||||
State.store.windowBounds = win.getBounds();
|
||||
State.store.displayid = screen.getDisplayMatching(State.store.windowBounds).id;
|
||||
};
|
||||
|
||||
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;
|
||||
minimized?: boolean;
|
||||
windowBounds?: Rectangle;
|
||||
displayid: int;
|
||||
|
||||
skippedUpdate?: string;
|
||||
firstLaunch?: boolean;
|
||||
|
|
Loading…
Reference in a new issue