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

Rendering model is broken with regard to updates #5265

Open pjanx opened 2 weeks ago

pjanx commented 2 weeks ago

Checklist

Describe the bug

See the screencaps.

How to reproduce

Make some compute-expensive changes within Fyne while updating different widgets.

Screenshots

Peek 2024-11-13 10-54.webm

https://github.com/user-attachments/assets/f8b65732-41fc-46e4-bacc-52ab522b0a28

Example code

Adjust the string repeat counts to make it appropriately slow.

package main

import (
    "strings"
    "time"

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

func main() {
    a := app.New()
    w := a.NewWindow("Bugs")
    w.Resize(fyne.NewSize(480, 360))
    me := widget.NewMultiLineEntry()
    l := widget.NewLabel("")
    w.SetContent(container.NewBorder(nil, nil, l, nil, me))

    long := strings.Repeat("Lorem ipsum dolor sit amet\n", 260)
    short := strings.Repeat("Lorem ipsum dolor sit amet\n", 240)
    var which bool
    t := time.NewTicker(time.Second / 2)
    go func() {
        for {
            <-t.C
            which = !which
            if which {
                me.SetText(long)
                l.SetText(":DDDDDDDDD")
            } else {
                me.SetText(short)
                l.SetText(":D")
            }
            me.TypedKey(&fyne.KeyEvent{Name: fyne.KeyPageDown})
        }
    }()
    w.ShowAndRun()
}

Fyne version

2.5.2

Go compiler version

1.23.2

Operating system and version

Linux, macOS

Additional Information

No response