Avoid content size guard to fix fullscreen menu layout

This commit is contained in:
Stu Leak 2026-01-15 03:05:43 -05:00
parent f1cbfa66c0
commit ed7a618a57

13
main.go
View File

@ -1862,19 +1862,16 @@ func (s *appState) setContent(body fyne.CanvasObject) {
update := func() {
currentSize := s.window.Canvas().Size()
bg := canvas.NewRectangle(backgroundColor)
sizeGuard := canvas.NewRectangle(color.Transparent)
if currentSize.Width > 0 && currentSize.Height > 0 {
sizeGuard.SetMinSize(currentSize)
} else {
sizeGuard.SetMinSize(fyne.NewSize(800, 600))
}
if body == nil {
s.window.SetContent(container.NewMax(bg, sizeGuard))
s.window.SetContent(bg)
return
}
// Wrap content with mouse button handler
wrapped := newMouseButtonHandler(container.NewMax(bg, sizeGuard, body), s)
wrapped := newMouseButtonHandler(container.NewMax(bg, body), s)
s.window.SetContent(wrapped)
if currentSize.Width > 0 && currentSize.Height > 0 {
wrapped.Resize(currentSize)
}
}
// Use async Do() instead of DoAndWait() to avoid deadlock when called from main goroutine