winit icon indicating copy to clipboard operation
winit copied to clipboard

Add more specific error messages for X11 failed initialization

Open notgull opened this issue 1 year ago • 4 comments

This ensures that, when X11 initialization fails, we know exactly why.

cc #3671

Signed-off-by: John Nunley [email protected]

  • [ ] Tested on all platforms changed
  • [ ] Added an entry to the changelog module if knowledge of this change could be valuable to users
  • [x] Updated documentation to reflect any user-facing changes, including notes of platform-specific behavior
  • [x] Created or updated an example program if it would help users understand this functionality
  • [x] Updated feature matrix, if new features were added or implemented

notgull avatar May 04 '24 00:05 notgull

In general, I think the better approach is to add proper annotation for the errors themselves.

Agreed, but this would require a breaking change.

notgull avatar May 04 '24 15:05 notgull

But X11 error is not a public API, so you'd just change the internal layout?

kchibisov avatar May 04 '24 15:05 kchibisov

Huh, I thought it was? Okay then, this can be fixed

notgull avatar May 04 '24 16:05 notgull

Huh, I thought it was? Okay then, this can be fixed

Everything inside the platform_impl is private, only platform is public.

kchibisov avatar May 04 '24 16:05 kchibisov

I'm still not entirely sure what to do with this and I think it'll add more boilerplate when splitting backends...

So, I'll keep it around for now because the change is rather small internally and provides no practical value, since all the info available in e.g. strace if you debug things like failed to load dynamic library.

kchibisov avatar May 23 '24 16:05 kchibisov

Since you've brought it in #3883, why not route everything into OsError, should be pretty much conservative and provide all the things needed?

You should also just forward the EventLoopError from the X11 backend like Wayland does.

kchibisov avatar Aug 22 '24 21:08 kchibisov