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

Forcing X11 doesn't work #3057

Closed
GiantBlargg opened this issue Aug 28, 2023 · 0 comments · Fixed by #3058
Closed

Forcing X11 doesn't work #3057

GiantBlargg opened this issue Aug 28, 2023 · 0 comments · Fixed by #3058
Labels

Comments

@GiantBlargg
Copy link

Since #3011 forcing X11 with with_x11 doesn't work.

The problem is here:
https://github.com/rust-windowing/winit/blob/7541220a419f0e383251c37be574fef9fd5827e4/src/platform_impl/linux/mod.rs#L754C1-L764C10

#[cfg(wayland_platform)]
if attributes.forced_backend == Some(Backend::Wayland)
    || env::var("WAYLAND_DISPLAY").is_ok()
{
    return EventLoop::new_wayland_any_thread().map_err(Into::into);
}

#[cfg(x11_platform)]
if attributes.forced_backend == Some(Backend::X) || env::var("DISPLAY").is_ok() {
    return Ok(EventLoop::new_x11_any_thread().unwrap());
}

If WAYLAND_DISPLAY is set, X never gets the chance to force itself.

@GiantBlargg GiantBlargg changed the title [Regression] Forcing X11 doesn't work Forcing X11 doesn't work Aug 28, 2023
notgull added a commit that referenced this issue Aug 28, 2023
Closes #3057 by making it so the forced backend is considered over all
else.

Signed-off-by: John Nunley <[email protected]>
notgull added a commit that referenced this issue Sep 2, 2023
Closes #3057 by making it so the forced backend is considered over all
else.

Signed-off-by: John Nunley <[email protected]>
kchibisov pushed a commit that referenced this issue Sep 3, 2023
Use forced backend over the env variables. 

Signed-off-by: John Nunley <[email protected]>
Fixes: #3057
kchibisov pushed a commit to kchibisov/winit that referenced this issue Oct 17, 2023
Use forced backend over the env variables. 

Signed-off-by: John Nunley <[email protected]>
Fixes: rust-windowing#3057
kchibisov pushed a commit that referenced this issue Oct 21, 2023
Use forced backend over the env variables. 

Signed-off-by: John Nunley <[email protected]>
Fixes: #3057
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging a pull request may close this issue.

2 participants