Skip to content

Commit

Permalink
Update persistence.go
Browse files Browse the repository at this point in the history
  • Loading branch information
Owen3H committed Oct 18, 2024
1 parent c9b2c11 commit ff5e53b
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions backend/app/persistence.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

Expand Down

0 comments on commit ff5e53b

Please sign in to comment.