Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Fyne and correct our thread handling to work with the new fyne.Do requirement #110

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions cmd/fyneterm/FyneApp.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@
[Source]
Repo = "https://github.com/fyne-io/terminal"
Dir = "cmd/fyneterm"

[Migrations]
fyneDo = true

32 changes: 14 additions & 18 deletions cmd/fyneterm/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,13 @@ func setupListener(t *terminal.Terminal, w fyne.Window) {
for {
config := <-listen

if config.Title == "" {
w.SetTitle(termTitle())
} else {
w.SetTitle(termTitle() + ": " + config.Title)
}
fyne.Do(func() {
if config.Title == "" {
w.SetTitle(termTitle())
} else {
w.SetTitle(termTitle() + ": " + config.Title)
}
})
}
}()
t.AddListener(listen)
Expand Down Expand Up @@ -74,18 +76,12 @@ func newTerminalWindow(a fyne.App, th fyne.Theme, debug bool) fyne.Window {
img.FillMode = canvas.ImageFillContain
over := canvas.NewRectangle(th.Color(termOverlay, a.Settings().ThemeVariant()))

ch := make(chan fyne.Settings)
go func() {
for {
<-ch

bg.FillColor = theme.Color(theme.ColorNameBackground)
bg.Refresh()
over.FillColor = th.Color(termOverlay, a.Settings().ThemeVariant())
over.Refresh()
}
}()
a.Settings().AddChangeListener(ch)
a.Settings().AddListener(func(s fyne.Settings) {
bg.FillColor = theme.Color(theme.ColorNameBackground)
bg.Refresh()
over.FillColor = th.Color(termOverlay, s.ThemeVariant())
over.Refresh()
})

t := terminal.New()
t.SetDebug(debug)
Expand Down Expand Up @@ -121,7 +117,7 @@ func newTerminalWindow(a fyne.App, th fyne.Theme, debug bool) fyne.Window {
if err != nil {
fyne.LogError("Failure in terminal", err)
}
w.Close()
fyne.Do(w.Close)
}()

return w
Expand Down
28 changes: 14 additions & 14 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/fyne-io/terminal
go 1.19

require (
fyne.io/fyne/v2 v2.5.3-rc7.0.20250120111557-621fc220edd7
fyne.io/fyne/v2 v2.6.0-alpha1
github.com/ActiveState/termtest/conpty v0.5.0
github.com/creack/pty v1.1.21
github.com/stretchr/testify v1.10.0
Expand All @@ -16,27 +16,27 @@ require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/fredbi/uri v1.1.0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/fyne-io/gl-js v0.0.0-20220119005834-d2da28d9ccfe // indirect
github.com/fyne-io/glfw-js v0.0.0-20241126112943-313d8a0fe1d0 // indirect
github.com/fyne-io/image v0.0.0-20220602074514-4956b0afb3d2 // indirect
github.com/go-gl/gl v0.0.0-20211210172815-726fda9656d6 // indirect
github.com/fyne-io/gl-js v0.1.0 // indirect
github.com/fyne-io/glfw-js v0.1.0 // indirect
github.com/fyne-io/image v0.1.0 // indirect
github.com/go-gl/gl v0.0.0-20231021071112-07e5d0ea2e71 // indirect
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20240506104042-037f3cc74f2a // indirect
github.com/go-text/render v0.2.0 // indirect
github.com/go-text/typesetting v0.2.0 // indirect
github.com/go-text/typesetting v0.2.1 // indirect
github.com/godbus/dbus/v5 v5.1.0 // indirect
github.com/gopherjs/gopherjs v1.17.2 // indirect
github.com/jeandeaual/go-locale v0.0.0-20241217141322-fcc2cadd6f08 // indirect
github.com/jsummers/gobmp v0.0.0-20151104160322-e2ba15ffa76e // indirect
github.com/nicksnyder/go-i18n/v2 v2.4.0 // indirect
github.com/jsummers/gobmp v0.0.0-20230614200233-a9de23ed2e25 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 // indirect
github.com/nicksnyder/go-i18n/v2 v2.5.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rymdport/portal v0.3.0 // indirect
github.com/srwiley/oksvg v0.0.0-20221011165216-be6e8873101c // indirect
github.com/srwiley/rasterx v0.0.0-20220730225603-2ab79fcdd4ef // indirect
github.com/yuin/goldmark v1.7.1 // indirect
golang.org/x/image v0.23.0 // indirect
golang.org/x/mobile v0.0.0-20231127183840-76ac6878050a // indirect
github.com/yuin/goldmark v1.7.8 // indirect
golang.org/x/image v0.24.0 // indirect
golang.org/x/net v0.25.0 // indirect
golang.org/x/sys v0.27.0 // indirect
golang.org/x/text v0.21.0 // indirect
golang.org/x/sys v0.30.0 // indirect
golang.org/x/text v0.22.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading