diff --git a/src/main/patcher.ts b/src/main/patcher.ts index e5b87290d..60b169af6 100644 --- a/src/main/patcher.ts +++ b/src/main/patcher.ts @@ -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");