fix(wayland): fix panic when an app requests presentation_feedback without having bound a display
Signed-off-by: Schmarni <marnistromer@gmail.com>
This commit is contained in:
@@ -53,14 +53,15 @@ opt-level = "s"
|
||||
lto = true
|
||||
codegen-units = 1
|
||||
panic = "abort"
|
||||
strip = "symbols"
|
||||
# strip = "symbols"
|
||||
debug = true
|
||||
|
||||
[profile.dev.package."*"]
|
||||
opt-level = 3
|
||||
|
||||
[patch.crates-io]
|
||||
bevy_mod_openxr = { git = "https://github.com/awtterpip/bevy_oxr" }
|
||||
bevy_mod_xr = { git = "https://github.com/awtterpip/bevy_oxr" }
|
||||
bevy_mod_openxr = { git = "https://github.com/awtterpip/bevy_oxr", rev = "9fd0c797"}
|
||||
bevy_mod_xr = { git = "https://github.com/awtterpip/bevy_oxr", rev = "9fd0c797" }
|
||||
bevy_gltf = { git = "https://github.com/Schmarni-Dev/bevy", branch = "gltf_backport" }
|
||||
# TODO: figure out how to not need this horrifing patch
|
||||
wgpu = { git = "https://github.com/Schmarni-Dev/wgpu", branch = "bad_dmabuf_workaround" }
|
||||
|
||||
12
src/main.rs
12
src/main.rs
@@ -476,12 +476,6 @@ fn cam_settings(
|
||||
}
|
||||
|
||||
fn xr_step(world: &mut World) {
|
||||
// update things like the Xr input methods
|
||||
world.run_schedule(PreFrameWait);
|
||||
input::process_input();
|
||||
let time = world.resource::<bevy::prelude::Time>().delta_secs_f64();
|
||||
nodes::root::Root::send_frame_events(time);
|
||||
|
||||
// we are targeting the frame after the wait
|
||||
if let Some(mut state) = world.get_resource_mut::<OxrFrameState>() {
|
||||
state.predicted_display_time = openxr::Time::from_nanos(
|
||||
@@ -489,6 +483,12 @@ fn xr_step(world: &mut World) {
|
||||
);
|
||||
}
|
||||
|
||||
// update things like the Xr input methods
|
||||
world.run_schedule(PreFrameWait);
|
||||
input::process_input();
|
||||
let time = world.resource::<bevy::prelude::Time>().delta_secs_f64();
|
||||
nodes::root::Root::send_frame_events(time);
|
||||
|
||||
let should_wait = world
|
||||
.run_system_cached(should_run_frame_loop)
|
||||
.unwrap_or(false);
|
||||
|
||||
@@ -22,7 +22,6 @@ use bevy::{
|
||||
use bevy_dmabuf::import::ImportedDmatexs;
|
||||
use mint::Vector2;
|
||||
use parking_lot::Mutex;
|
||||
use waynest_server::Client as _;
|
||||
use std::{
|
||||
fmt::Display,
|
||||
sync::{Arc, OnceLock, Weak},
|
||||
@@ -32,6 +31,7 @@ use waynest_protocols::server::{
|
||||
core::wayland::{wl_output::Transform, wl_surface::*},
|
||||
stable::presentation_time::wp_presentation_feedback::{Kind, WpPresentationFeedback},
|
||||
};
|
||||
use waynest_server::Client as _;
|
||||
|
||||
pub static WL_SURFACE_REGISTRY: Registry<Surface> = Registry::new();
|
||||
|
||||
@@ -305,13 +305,9 @@ impl Surface {
|
||||
.drain(..)
|
||||
.collect::<Vec<_>>();
|
||||
for feedback in feedbacks {
|
||||
feedback
|
||||
.sync_output(
|
||||
client,
|
||||
feedback.0,
|
||||
client.display().output.get().unwrap().id,
|
||||
)
|
||||
.await?;
|
||||
if let Some(display_id) = client.display().output.get().map(|display| display.id) {
|
||||
feedback.sync_output(client, feedback.0, display_id).await?;
|
||||
}
|
||||
let cycle_lo = refresh_cycle as u32;
|
||||
let cycle_hi = (refresh_cycle >> 32) as u32;
|
||||
feedback
|
||||
|
||||
Reference in New Issue
Block a user