fyne-io / fyne

Cross platform GUI toolkit in Go inspired by Material Design
https://fyne.io/
Other
25.25k stars 1.4k forks source link

Application starts with main container half sized #5249

Closed hkparker closed 1 week ago

hkparker commented 2 weeks ago

Checklist

Describe the bug

This has been happening for a few years and I've just been ignoring it since I haven't launched anything publicly yet and I don't know how anyone can easily reproduce this, but I think it's worth bringing up now and seeing if others have experienced this.

Sometimes, randomly, when I start my application, the main container is halved in size within the main window, on the bottom half. This remains the case until I interact with anything that causes a layout refresh (resizing the window, opening a different container, etc).

What's interesting about this is that the mouse position tracks where the widgets should be. The menu, for example, is displayed half way down as well, however I can click at the very top at the window to interact with it. It's as if the system for tracking where the widgets are for mouse purposes is accurate, and out of sync with where they are displayed.

How to reproduce

Unfortunately I don't have an easy example. My app does set the initial size with fyneUI.mainWindow.Resize(fyne.Size{Height: defaultHeight, Width: defaultWidth}) before showing the main window. I thought that might be relevant, but I moved the Resize call until after the main window and container are shown and was still able to reproduce this. I've tried refreshing the main container after setting it the first time, since I figured the window size should be set at that point, but it didn't help.

Screenshots

No response

Example code

(not sure I can share useful code yet)

Fyne version

2.5.0

Go compiler version

go1.23.2 linux/amd64

Operating system and version

Arch Linux

Additional Information

No response

dweymouth commented 1 week ago

Sounds like a duplicate of #4964 ?

hkparker commented 1 week ago

Oh, I guess so! I tried searching for issues like this but that didn't come up. In my case it's always the bottom half as opposed to a quarter like your example, but yes, I think it's the same. It would be a huge blocker if my project was publicly available tbh, it's a very frequent occurrence. I'll try your hacky workaround soon as a stopgap and report back when I do, thanks for sharing that.

Closing as a duplicate.