Skip to content

wayland: text renders with wrong font size on startup until hover (regression from v2.7.4) #6447

Description

@gbonnema

Checklist

  • I have searched the issue tracker for open issues that relate to the same problem, before opening a new one.
  • This issue only relates to a single bug. I will open new issues for any other problems.

Describe the bug

When opening a window that contains a widget.List as its content, items are rendered with an incorrect (much larger) font size on startup. Moving the mouse cursor over a list item triggers a re-render that corrects the font and layout.

On v2.7.4, the same code renders correctly on startup without any mouse interaction.

This is similar to the previously fixed #645 ("Initial window display is blank on Gnome until hover or resize"), but that issue was resolved in 2020 and this appears to be a new regression in v2.8.0.

How to reproduce

  1. Save the example code below as main.go in a new directory
  2. Initialize and build for v2.8.0:
    go mod init fyne28test
    go get fyne.io/fyne/v2@v2.8.0
    go mod tidy
    CGO_ENABLED=1 go build -o list-test-280 .
    
  3. Build for v2.7.4 (same directory):
    go get fyne.io/fyne/v2@v2.7.4
    go mod tidy
    CGO_ENABLED=1 go build -o list-test-274 .
    
  4. Run ./list-test-280
  5. Observe: items appear with an incorrect (much larger) font size
  6. Move the mouse cursor over a list item — the font and layout correct themselves
  7. Close the window, run ./list-test-274
  8. Observe: the list renders correctly on startup without any mouse interaction

Screenshots

Image Image

Example code

package main

import (
	"fmt"

	"fyne.io/fyne/v2"
	"fyne.io/fyne/v2/app"
	"fyne.io/fyne/v2/widget"
)

func main() {
	a := app.New()
	w := a.NewWindow("List font test")
	w.Resize(fyne.NewSize(400, 300))

	data := make([]string, 20)
	for i := range data {
		data[i] = fmt.Sprintf("Item %d", i)
	}

	list := widget.NewList(
		func() int { return len(data) },
		func() fyne.CanvasObject { return widget.NewLabel("template") },
		func(id widget.ListItemID, obj fyne.CanvasObject) {
			obj.(*widget.Label).SetText(data[id])
		},
	)

	w.SetContent(list)
	w.ShowAndRun()
}

Fyne version

v2.8.0 (works correctly on v2.7.4)

Go compiler version

go1.23.0 linux/amd64

Operating system and version

Ubuntu-based (Pop!_OS), Linux 6.16.3, GNOME desktop, Wayland

Additional Information

The terminal prints the following warning on startup (not seen on v2.7.4):

*** This application has not been migrated to the fyne.Do threading model ***
*** The next major Fyne release will remove this safety! ***
*** Read more at https://docs.fyne.io/started/goroutines ***

Setting fyneDo = true in FyneApp.toml does not resolve the issue.

The application does not use any goroutines for UI updates; all widget construction and SetContent happen on the main goroutine before ShowAndRun.

In a more complex application where the widget.List is wrapped inside a custom focusable widget, the same underlying issue manifests as a completely blank list area (no items rendered at all) until hover. This suggests the initial layout/theme pass is incomplete, with the severity depending on the widget hierarchy.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    WaylandIssues related to Wayland supportunverifiedA bug that has been reported but not verified

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions