-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Better error reporting / handling when OpenGL is not available #2689
Comments
Yes
It doesn't stricly speaking require acceleration, but it does require an OpenGL API so that we can use the same code for many platforms. There are discussions about using OS native APIs for drawing graphics but as we currently support about 7 OS that is clearly a lot more work than is required with the current infrastructure. |
We want to add our vote to this ticket. If something goes wrong with an app, it should at least alert the user and preferably provide useful information as to the cause of the problem. |
@kheyse-oqton and anyone interested here, I have been thinking of a few ways to solve this problem and was wondering what was your opinion on the following possibility:
(I am ruling out providing a software backend at the moment, as that is a lot of work to get it to a useful state). |
I’m in favour of the first option. Statically linking mesa is, as you say, going to make binaries even bigger and add more complexity to the building. The less C-deps the better in my opinion. |
First option would definitely be an improvement! |
Thanks to https://github.com/rodrigocfd/windigo, it shouldn't be very hard to get a MessageBox going when we fail to initialize GL. For reference, extract from windigo, under MIT license. First get a pointer to MessageBox address:
With that it is possible to trigger a MessageBox with the following function:
|
Looks pretty lightweight - but I don't think it's made a release yet, so tread with caution? |
@andydotxyz I was not intending to include them as dependency. The code necessary is just the code pasted above, so can be integrated directly in our code. |
Oh, haha I see. Perfect :) |
I have been trying to figure out a way to test without a GPU, but none of my Windows computer can run a Windows in a VM to a point where I can test this. If anyone here would be able to check https://github.com/fyne-io/fyne/tree/feature/graceful-failure-windows-gl . It should now display a MessageBox when there is no GPU available. |
Thanks @Bluebugs here is it working on my WIndows VM with the GPU turned off... |
This will be in the next 2.2 release :-) And can already be tested with develop. |
When a Fyne app crashes because it could not create a window this is normally due to a driver issues.
The OS or other dependency is not working.
We should report this better, so developers know what to do or where to report it.
Or to update their drivers etc?
Is it possible to construct a solution with the existing API?
The panics can get pasted here, but we have to interpret the data and often the developer could have solved it themselves.
Describe the solution you'd like to see:
Catch the panic and log the error with suggested fix/next steps and cleanly exit
The text was updated successfully, but these errors were encountered: