mirror of
https://github.com/Vendicated/Vencord.git
synced 2025-05-10 17:35:50 +02:00
fix "Disable minimum window size" option (#3335)
Fixes #3330 Fixes #878
This commit is contained in:
parent
1fa6181f7e
commit
fe0309ffaa
1 changed files with 12 additions and 8 deletions
|
@ -87,6 +87,11 @@ if (!IS_VANILLA) {
|
|||
options.backgroundColor = "#00000000";
|
||||
}
|
||||
|
||||
if (settings.disableMinSize) {
|
||||
options.minWidth = 0;
|
||||
options.minHeight = 0;
|
||||
}
|
||||
|
||||
const needsVibrancy = process.platform === "darwin" && settings.macosVibrancyStyle;
|
||||
|
||||
if (needsVibrancy) {
|
||||
|
@ -99,6 +104,12 @@ if (!IS_VANILLA) {
|
|||
process.env.DISCORD_PRELOAD = original;
|
||||
|
||||
super(options);
|
||||
|
||||
if (settings.disableMinSize) {
|
||||
// Disable the Electron call entirely so that Discord can't dynamically change the size
|
||||
this.setMinimumSize = (width: number, height: number) => { };
|
||||
}
|
||||
|
||||
initIpc(this);
|
||||
} else super(options);
|
||||
}
|
||||
|
@ -117,16 +128,9 @@ if (!IS_VANILLA) {
|
|||
BrowserWindow
|
||||
};
|
||||
|
||||
// Patch appSettings to force enable devtools and optionally disable min size
|
||||
// Patch appSettings to force enable devtools
|
||||
onceDefined(global, "appSettings", s => {
|
||||
s.set("DANGEROUS_ENABLE_DEVTOOLS_ONLY_ENABLE_IF_YOU_KNOW_WHAT_YOURE_DOING", true);
|
||||
if (settings.disableMinSize) {
|
||||
s.set("MIN_WIDTH", 0);
|
||||
s.set("MIN_HEIGHT", 0);
|
||||
} else {
|
||||
s.set("MIN_WIDTH", 940);
|
||||
s.set("MIN_HEIGHT", 500);
|
||||
}
|
||||
});
|
||||
|
||||
process.env.DATA_DIR = join(app.getPath("userData"), "..", "Vencord");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue