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

Fix app.running field only being set if starting with app.Run() #4193

Merged
merged 11 commits into from
Sep 4, 2023

Conversation

Jacalz
Copy link
Member

@Jacalz Jacalz commented Aug 24, 2023

Description:

This fixes the app.running field only being set if running with app.Run() and not when using window.ShowAndRun(), i.e. it was false for the majority of applications. The glfw driver already had a flag to check if it was running or not. The PR moves the running flag into the mobile driver and cleans up the one we already had in the glfw driver.

Checklist:

  • Tests included.
  • Lint and formatter run with no errors.
  • Tests all pass.

@Jacalz Jacalz added this to the "E" release, late 2023 milestone Aug 24, 2023
@coveralls
Copy link

coveralls commented Aug 24, 2023

Coverage Status

coverage: 65.314% (-0.005%) from 65.319% when pulling bed11fa on Jacalz:init-cleanup-improved into b8234f7 on fyne-io:develop.

@Jacalz Jacalz changed the title Improvement to glfw driver init Fix app.running field only being set if starting with app.Run() Aug 24, 2023
@Jacalz Jacalz marked this pull request as ready for review August 24, 2023 18:39
@Jacalz
Copy link
Member Author

Jacalz commented Aug 24, 2023

The plan was initially to apply a re-roll of 460fa8d but it felt better to work on that separately.

@andydotxyz
Copy link
Member

In testing with fyne_demo closing it I get this panic:

panic: close of closed channel

goroutine 1 [running, locked to thread]:
fyne.io/fyne/v2/internal/driver/glfw.(*gLDriver).Quit(0x140001e5700?)
	/Users/andy/Code/Fyne/fyne/internal/driver/glfw/driver.go:110 +0xb4
fyne.io/fyne/v2/internal/driver/glfw.(*window).destroy(0x140005023c0, 0x140001e5700)
	/Users/andy/Code/Fyne/fyne/internal/driver/glfw/window.go:283 +0x60
fyne.io/fyne/v2/internal/driver/glfw.(*gLDriver).runGL(0x140001e5700)
	/Users/andy/Code/Fyne/fyne/internal/driver/glfw/loop.go:137 +0x53c
fyne.io/fyne/v2/internal/driver/glfw.(*gLDriver).Run(0x140001e5700)
	/Users/andy/Code/Fyne/fyne/internal/driver/glfw/driver.go:168 +0x80
fyne.io/fyne/v2/internal/driver/glfw.(*window).ShowAndRun(0x140005023c0)
	/Users/andy/Code/Fyne/fyne/internal/driver/glfw/window.go:227 +0x2c
main.main()
	/Users/andy/Code/Fyne/fyne/cmd/fyne_demo/main.go:68 +0x4b0
exit status 2

@Jacalz
Copy link
Member Author

Jacalz commented Aug 25, 2023

I haven't been able to replicate the crash but I pushed a commit that should solve it hopefully.

@Jacalz Jacalz merged commit b0f71b0 into fyne-io:develop Sep 4, 2023
11 checks passed
@Jacalz Jacalz deleted the init-cleanup-improved branch September 4, 2023 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants