bracket-lib: Crash on mouse hover on Wayland
Hello,
I am getting a crash running the tutorial code. This is on Fedora 36, running Gnome and Wayland. The window is created normally, but as soon as the mouse cursor hovers the window, the program exits with the following output. If the mouse cursor happens to be within the window bounds when the program starts, the program exits immediately.
Initialized OpenGL with: 4.6 (Core Profile) Mesa 22.1.7, Shader Language Version: 4.60
Error sending request: Resource temporarily unavailable
The contents of the project:
Cargo.toml
[package]
name = "bracket_bug"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
bracket-lib = "0.8"
main.rs
use bracket_lib::prelude::*;
struct State {}
impl GameState for State {
fn tick(&mut self, ctx: &mut BTerm) {
ctx.print(1, 1, "Hello Bracket World");
}
}
fn main() -> BError {
let context = BTermBuilder::simple80x50()
.with_title("Hello Minimal Bracket World")
.build()?;
let gs: State = State {};
main_loop(context, gs)
}
I am happy to provide more information, but please bear in mind I am just learning Rust, and I would appreciate it if you could also provide some instructions on how to obtain any traces/logs you might want to see.
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 6
- Comments: 15
Commits related to this issue
- #318 - This solves the Wayland crash on my system. More testing required. — committed to amethyst/bracket-lib by thebracket a year ago
- Revert "#318 - This solves the Wayland crash on my system. More testing required." This reverts commit 0d2d5e6a9a8e7c7ae3710cfef85be4cab0109a27. — committed to capslock/bracket-lib by capslock a year ago
- Revert "#318 - This solves the Wayland crash on my system. More testing required." This reverts commit 0d2d5e6a9a8e7c7ae3710cfef85be4cab0109a27. — committed to capslock/bracket-lib by capslock a year ago
This bug is fixed by upgrading rltk from 0.8.0 to 0.8.7 in Cargo.toml or using
rltk = { git = "https://github.com/amethyst/bracket-lib.git" }
in Cargo.toml.I’ve added a delay back into the main loop when
low_cpu
isn’t enabled. It’s not ideal, but it seems to have solved the crash on my system at least. Anyone care to test it for me, please?Same issue on Fedora / Wayland. The webgpu workaround seems to work for me:
Using this in my project and this fixed the crash for me as well! I’m using Arch with Hyprland as a Compositor
Thank you ser, you are a lifesaver. This issue was driving me insane!
Works correctly with Fedora 37, Wayland and GNOME 43.2. Thanks! 👍
Same issue for me with Fedora 36, GNOME 42 and Wayland. It must be a issue with a project dependency, as it was working correctly until I updated my crates with
cargo update
a few weeks ago.If you want to focus on learning Rust with this toolkit and you don’t mind using X.org, just switch to a GNOME on X.org session until there’s a fix with an upstream dependency.