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 timeout if the portal DBus is not present #4800

Merged
merged 5 commits into from May 6, 2024

Conversation

andydotxyz
Copy link
Member

Just update a cache when the value is found and refresh app

Checklist:

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

Just update a cache when the value is found and refresh app
@andydotxyz andydotxyz requested a review from Jacalz April 21, 2024 20:06
@coveralls
Copy link

coveralls commented Apr 21, 2024

Coverage Status

coverage: 65.003% (+0.1%) from 64.861%
when pulling 23c12a3 on andydotxyz:fix/portalwait
into 66b892d on fyne-io:develop.

app/app_xdg.go Outdated
func defaultVariant() fyne.ThemeVariant {
return findFreedestktopColorScheme()
return currentVariant
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm. I think this might be introducing a race condition given that it is modified in a different goroutine? Might be worth using something like an atomic.Pointer or a lock?

@andydotxyz
Copy link
Member Author

andydotxyz commented Apr 24, 2024

Looks like some Ubuntu/Microsoft dependency has taken down the build CI setup :(

@andydotxyz
Copy link
Member Author

Whatever the problem was it is fixed upstream.
Just added a nil check before casting out the atomic.Value and it should be ready now.

Copy link
Member

@Jacalz Jacalz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I realised that there was a cleaner and faster way to do this 😅

app/app_xdg.go Outdated
@@ -20,8 +20,15 @@ import (
"fyne.io/fyne/v2/theme"
)

var currentVariant atomic.Value
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm. I actually have a better idea. Given that fyne.ThemeVariant is a uint, you can get cleaner and faster code by just using an atomic.Uint64 and cast the value to a fyne.ThemeVariant where loading and storing.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, done

app/app_xdg.go Outdated Show resolved Hide resolved
app/app_xdg.go Outdated Show resolved Hide resolved
@andydotxyz andydotxyz requested a review from Jacalz May 5, 2024 11:44
Copy link
Member

@Jacalz Jacalz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect. Thanks

@andydotxyz andydotxyz merged commit d247b0e into fyne-io:develop May 6, 2024
12 checks passed
@andydotxyz andydotxyz deleted the fix/portalwait branch May 6, 2024 17:08
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.

None yet

3 participants