mirror of
https://github.com/Vendicated/Vencord.git
synced 2025-05-11 09:56:03 +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";
|
options.backgroundColor = "#00000000";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (settings.disableMinSize) {
|
||||||
|
options.minWidth = 0;
|
||||||
|
options.minHeight = 0;
|
||||||
|
}
|
||||||
|
|
||||||
const needsVibrancy = process.platform === "darwin" && settings.macosVibrancyStyle;
|
const needsVibrancy = process.platform === "darwin" && settings.macosVibrancyStyle;
|
||||||
|
|
||||||
if (needsVibrancy) {
|
if (needsVibrancy) {
|
||||||
|
@ -99,6 +104,12 @@ if (!IS_VANILLA) {
|
||||||
process.env.DISCORD_PRELOAD = original;
|
process.env.DISCORD_PRELOAD = original;
|
||||||
|
|
||||||
super(options);
|
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);
|
initIpc(this);
|
||||||
} else super(options);
|
} else super(options);
|
||||||
}
|
}
|
||||||
|
@ -117,16 +128,9 @@ if (!IS_VANILLA) {
|
||||||
BrowserWindow
|
BrowserWindow
|
||||||
};
|
};
|
||||||
|
|
||||||
// Patch appSettings to force enable devtools and optionally disable min size
|
// Patch appSettings to force enable devtools
|
||||||
onceDefined(global, "appSettings", s => {
|
onceDefined(global, "appSettings", s => {
|
||||||
s.set("DANGEROUS_ENABLE_DEVTOOLS_ONLY_ENABLE_IF_YOU_KNOW_WHAT_YOURE_DOING", true);
|
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");
|
process.env.DATA_DIR = join(app.getPath("userData"), "..", "Vencord");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue