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

Sometimes fyne fails to setup dark mode #4758

Open
2 tasks done
lostdusty opened this issue Mar 31, 2024 · 2 comments
Open
2 tasks done

Sometimes fyne fails to setup dark mode #4758

lostdusty opened this issue Mar 31, 2024 · 2 comments
Labels
unverified A bug that has been reported but not verified

Comments

@lostdusty
Copy link

Checklist

  • I have searched the issue tracker for open issues that relate to the same problem, before opening a new one.
  • This issue only relates to a single bug. I will open new issues for any other problems.

Describe the bug

Happens randomly, with error code 0x800703e6.
image
Dark mode, however, is still set successfully.

How to reproduce

Use go run . until it appears. Depends on your luck I guess.

Screenshots

No response

Example code

func main() {
	a := app.New()
	w := a.NewWindow("Hello")

	hello := widget.NewLabel("Hello Fyne!")
	w.SetContent(container.NewVBox(
		hello,
		widget.NewButton("Hi!", func() {
			hello.SetText("Welcome :)")
		}),
	))

	w.ShowAndRun()
}

Fyne version

2.4.4

Go compiler version

1.22.0

Operating system and version

Windows 10

Additional Information

Modified internal/driver/glfw/window_windows.go to show the error code.

@lostdusty lostdusty added the unverified A bug that has been reported but not verified label Mar 31, 2024
@montovaneli
Copy link

montovaneli commented Apr 3, 2024

Sometimes this also happens here. Even though the theme is correctly set in the 'fyne elements', the Windows' own window top bar remains in light theme, as in the print below (exactly when it occurred). It throws the same error 0x800703e6.

image

The right behavior for the window would be:

image

I read the error HRESULT =0x800703e6 represents - ERROR_NOACCESS. A description of the code reveals the message invalid access to memory location.

Perhaps a possibility is that the window fyne tries to set to dark mode isn't fully initialized yet?

I take this opportunity to ask you: Were you using the SystemTray or SystemTrayMenu API when this occurred?

@lostdusty
Copy link
Author

I were using none of them. At least on my machine the theme is still applied successfully, and I get the following error description: "The operation completed successfully."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
unverified A bug that has been reported but not verified
Projects
None yet
Development

No branches or pull requests

2 participants