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

Cleanup GLFW init to avoid needing a sync.Once #4177

Merged
merged 1 commit into from
Aug 23, 2023

Conversation

Jacalz
Copy link
Member

@Jacalz Jacalz commented Aug 22, 2023

Description:

We previously called glfw.Init() before doing anything that needed it to be called (i.e. when creating a window and when starting the run loop) which led to init running multiple times. The solution was to protect it using a sync.Once but I realized that we can avoid it by just doing init on driver creation instead. This cleans up the code and makes window creation slightly faster as an added benefit.

Checklist:

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

@coveralls
Copy link

coveralls commented Aug 22, 2023

Coverage Status

coverage: 65.297% (+0.02%) from 65.279% when pulling 460fa8d on Jacalz:init-cleanup into 060343c on fyne-io:develop.

@Jacalz
Copy link
Member Author

Jacalz commented Aug 22, 2023

I noticed that I accidentally pushed two unrelated commits here. Will move those out to a separate PR.

@Jacalz Jacalz merged commit d2a24a9 into fyne-io:develop Aug 23, 2023
11 checks passed
@Jacalz Jacalz deleted the init-cleanup branch August 23, 2023 15:47
Jacalz added a commit to Jacalz/fyne that referenced this pull request Aug 24, 2023
Jacalz added a commit to Jacalz/fyne that referenced this pull request Nov 18, 2023
… with the application not having started. This cleans up some of the init code to avoid calling init multiple times (when starting and when creating a new windows).

Replaces fyne-io#4177
Jacalz added a commit to Jacalz/fyne that referenced this pull request Nov 18, 2023
This replaces my previous PR which had to be reverted due to an issue with the application not having started. This cleans up some of the init code to avoid calling init multiple times (when starting and when creating a new windows).
It also includes an extra change to set up the device field more coherently.

Replaces fyne-io#4177
@Jacalz Jacalz mentioned this pull request Nov 18, 2023
3 tasks
Jacalz added a commit to Jacalz/fyne that referenced this pull request Jan 6, 2024
This replaces my previous PR which had to be reverted due to an issue with the application not having started. This cleans up some of the init code to avoid calling init multiple times (when starting and when creating a new windows).
It also includes an extra change to set up the device field more coherently.

Replaces fyne-io#4177
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