You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running `target/debug/bug-report`
Failed to initialize graphics, trying secondary backends.. Please mention this if you encounter any bugs!
thread 'main' panicked at /home/philipp/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ggez-0.9.3/src/graphics/context.rs:566:14:
called `Option::unwrap()` on a `None` value
UPD
This seems to be a xinit issue:
When calling window.current_monitor() I get None, but as weird as it is, when calling window.available_monitors() I get my monitor and can check the resolution.
use ggez::{event,Context,GameResult};fnmain() -> GameResult{let window_mode = ggez::conf::WindowMode::default().resizable(true).dimensions(1024.0,1024.0);let cb = ggez::ContextBuilder::new("Invoke","Popov Philipp").window_mode(window_mode);let(mut ctx, event_loop) = cb.build()?;ifletSome(_monitor) = ctx.gfx.window().current_monitor(){println!("I have a monitor!");}else{println!("There is no monitor...");}for monitor in ctx.gfx.window().available_monitors(){for mode in monitor.video_modes(){println!("{:?}", mode);}}Ok(())}
Cargo run output:
Failed to initialize graphics, trying secondary backends.. Please mention this if you encounter any bugs!
There is no monitor...
Wayland(VideoMode { size: PhysicalSize { width: 3840, height: 2160 }, bit_depth: 32, refresh_rate_millihertz: 59997, monitor: MonitorHandle { proxy: wl_output@14 } })
I guess the only thing that can be done here is to handle the None value when calling window.available_monitors() instead of unwrapping.
The text was updated successfully, but these errors were encountered:
Describe the bug
When calling
ctx.gfx.supported_resolutions()
program panics on callingOption::unwrap() on a None value
To Reproduce
Here's a small code snippet that panics
Cargo run output:
Hardware and Software:
UPD
This seems to be a
xinit
issue:When calling
window.current_monitor()
I getNone
, but as weird as it is, when callingwindow.available_monitors()
I get my monitor and can check the resolution.Cargo run output:
I guess the only thing that can be done here is to handle the
None
value when callingwindow.available_monitors()
instead of unwrapping.The text was updated successfully, but these errors were encountered: