From ff5e53bb44ae7978797af2baf4334708b998ab2e Mon Sep 17 00:00:00 2001 From: O3H Date: Fri, 18 Oct 2024 19:34:41 +0100 Subject: [PATCH] Update persistence.go --- backend/app/persistence.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/backend/app/persistence.go b/backend/app/persistence.go index b4102a9..29c9d05 100644 --- a/backend/app/persistence.go +++ b/backend/app/persistence.go @@ -50,18 +50,17 @@ func (persistence *Persistence) Save() error { // The frontend must still be loaded to call these runtime methods. func (persistence *Persistence) ApplyCurrentWindowState(ctx context.Context) { + x, y := wRuntime.WindowGetPosition(ctx) + persistence.SetWindowX(x) + persistence.SetWindowY(y) + maximized := wRuntime.WindowIsMaximised(ctx) persistence.SetMaximized(maximized) if !maximized { w, h := wRuntime.WindowGetSize(ctx) - x, y := wRuntime.WindowGetPosition(ctx) - persistence.SetWindowWidth(uint16(w)) persistence.SetWindowHeight(uint16(h)) - - persistence.SetWindowX(x) - persistence.SetWindowY(y) } }