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

Reintroduce ability to query use of X11 or Wayland as backend on raw EventLoop #3670

Closed
vorporeal opened this issue May 1, 2024 · 1 comment · Fixed by #3672
Closed

Reintroduce ability to query use of X11 or Wayland as backend on raw EventLoop #3670

vorporeal opened this issue May 1, 2024 · 1 comment · Fixed by #3672
Labels
S - enhancement Wouldn't this be the coolest?

Comments

@vorporeal
Copy link

Description

Pre 0.30, EventLoopWindowTargetExtX11 enabled users to invoke is_x11 on an EventLoop, as an EventLoop could be coerced into an EventLoopWindowTarget.

With the 0.30 API changes that replaced EventLoopWindowTarget with ActiveEventLoop, there is no longer a way to perform this check without doing something indirect/awkward like doing a match on event_loop.owned_display_handle().raw_display_handle().

This functionality was used in our application to determine whether to invoke winit::platform::x11::register_xlib_error_hook before starting the event loop. While we could set up our error hook callback as part of the init event, we'd prefer to do it before starting the event loop for maximum "coverage".

Relevant platforms

X11

@vorporeal vorporeal added the S - enhancement Wouldn't this be the coolest? label May 1, 2024
@kchibisov
Copy link
Member

Yeah, probably was just forgotten. Using raw-window-handle and matches! should be fine as well.

Though, in the future such identity may go away anyway when the backends could be plugged/etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S - enhancement Wouldn't this be the coolest?
Development

Successfully merging a pull request may close this issue.

2 participants