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

Add more specific error messages for X11 failed initialization #3679

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

notgull
Copy link
Member

@notgull notgull commented May 4, 2024

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

cc #3671

Signed-off-by: John Nunley dev@notgull.net

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

@notgull notgull requested a review from kchibisov as a code owner May 4, 2024 00:50
@notgull notgull changed the title bugfix: Add tracing messages for X initialization Add tracing messages for X initialization May 4, 2024
Copy link
Member

@kchibisov kchibisov left a comment

Choose a reason for hiding this comment

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

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

Not sure how visible the tracing stuff would be when you actually boil from winit and likely exit, etc.

src/changelog/unreleased.md Outdated Show resolved Hide resolved
src/platform_impl/linux/x11/xdisplay.rs Outdated Show resolved Hide resolved
@notgull
Copy link
Member Author

notgull commented May 4, 2024

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

Agreed, but this would require a breaking change.

@kchibisov
Copy link
Member

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

@notgull
Copy link
Member Author

notgull commented May 4, 2024

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

@kchibisov
Copy link
Member

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

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

@notgull notgull requested a review from kchibisov May 5, 2024 01:23
@notgull notgull changed the title Add tracing messages for X initialization Add more specific error messages for X11 failed initialization May 5, 2024
@@ -17,7 +17,17 @@ pub enum ExternalError {
/// The error type for when the requested operation is not supported by the backend.
#[derive(Clone)]
pub struct NotSupportedError {
_marker: (),
inner: NotSupportedRepr,
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't we do it uniformly with the rest of the errors? Since we generally point to platform_impl from here?

Though, in the current state of things it doesn't matter that much.

Copy link
Member Author

Choose a reason for hiding this comment

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

That would add a lot of additional code for little benefit

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

cc #3671

Signed-off-by: John Nunley <dev@notgull.net>
Signed-off-by: John Nunley <dev@notgull.net>
Signed-off-by: John Nunley <dev@notgull.net>
Signed-off-by: John Nunley <dev@notgull.net>
Signed-off-by: John Nunley <dev@notgull.net>
@kchibisov
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants