Fix window bounds issue #10
This commit is contained in:
parent
f82bd92ff5
commit
f177b331db
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -243,6 +243,11 @@ export default new class V2_SettingsPanel {
|
||||||
if (id === "no_window_bound"){
|
if (id === "no_window_bound"){
|
||||||
let appSettings = remote.getGlobal("appSettings")
|
let appSettings = remote.getGlobal("appSettings")
|
||||||
appSettings.set("NO_WINDOWS_BOUND", enabled)
|
appSettings.set("NO_WINDOWS_BOUND", enabled)
|
||||||
|
|
||||||
|
appSettings.delete("IS_MAXIMIZED")
|
||||||
|
appSettings.delete("IS_MINIMIZED")
|
||||||
|
appSettings.delete("WINDOW_BOUNDS")
|
||||||
|
|
||||||
appSettings.save()
|
appSettings.save()
|
||||||
remote.app.relaunch()
|
remote.app.relaunch()
|
||||||
remote.app.exit()
|
remote.app.exit()
|
||||||
|
|
|
@ -151,6 +151,8 @@ function saveWindowConfig(browserWindow) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(settings.get("NO_WINDOWS_BOUND"))return
|
||||||
|
|
||||||
settings.set('IS_MAXIMIZED', browserWindow.isMaximized());
|
settings.set('IS_MAXIMIZED', browserWindow.isMaximized());
|
||||||
settings.set('IS_MINIMIZED', browserWindow.isMinimized());
|
settings.set('IS_MINIMIZED', browserWindow.isMinimized());
|
||||||
if (!settings.get('IS_MAXIMIZED') && !settings.get('IS_MINIMIZED')) {
|
if (!settings.get('IS_MAXIMIZED') && !settings.get('IS_MINIMIZED')) {
|
||||||
|
@ -203,14 +205,14 @@ function doAABBsOverlap(a, b) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function applyWindowBoundsToConfig(mainWindowOptions) {
|
function applyWindowBoundsToConfig(mainWindowOptions) {
|
||||||
if (!settings.get('WINDOW_BOUNDS')) {
|
const bounds = settings.get('WINDOW_BOUNDS')
|
||||||
|
if (!bounds) {
|
||||||
mainWindowOptions.center = true;
|
mainWindowOptions.center = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const bounds = settings.get('WINDOW_BOUNDS');
|
bounds.width = typeof bounds.width === "number" ? Math.max(MIN_WIDTH, bounds.width) : mainWindowOptions.width;
|
||||||
bounds.width = Math.max(MIN_WIDTH, bounds.width);
|
bounds.height = typeof bounds.height === "number" ? Math.max(MIN_HEIGHT, bounds.height) : mainWindowOptions.height;
|
||||||
bounds.height = Math.max(MIN_HEIGHT, bounds.height);
|
|
||||||
|
|
||||||
let isVisibleOnAnyScreen = false;
|
let isVisibleOnAnyScreen = false;
|
||||||
const displays = electron.screen.getAllDisplays();
|
const displays = electron.screen.getAllDisplays();
|
||||||
|
|
Loading…
Reference in New Issue