From 7b7c15ad273e3338e18976e79c1bf98de62a822f Mon Sep 17 00:00:00 2001 From: Leonid Nikitin Date: Sat, 16 Mar 2024 21:45:14 +0500 Subject: [PATCH] Fixed bug related to incorrect window size. Sometimes when starting a program the program window was small. --- kernel/window.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/kernel/window.go b/kernel/window.go index 4d6d4c4..ce9bfa9 100644 --- a/kernel/window.go +++ b/kernel/window.go @@ -22,7 +22,8 @@ type Window struct { } func newWindow(w fyne.Window, layout LayoutContract) Window { - w.Resize(fyne.Size{Width: 1039, Height: 599}) + windowSize := fyne.Size{Width: 1039, Height: 599} + w.Resize(windowSize) w.CenterOnScreen() go func() { @@ -30,11 +31,10 @@ func newWindow(w fyne.Window, layout LayoutContract) Window { * Bug fixed. * When starting the program, sometimes the window was displayed incorrectly. */ + windowSize.Width += 1 + windowSize.Height += 1 time.Sleep(time.Millisecond * 500) - size := w.Canvas().Size() - size.Width += 1 - size.Height += 1 - w.Resize(size) + w.Resize(windowSize) }() return Window{