fix: polish stuff a bit

This commit is contained in:
Nova
2024-06-27 16:51:33 -04:00
parent d17841ec7a
commit f08f3e4e4b
11 changed files with 104 additions and 98 deletions

View File

@@ -24,7 +24,7 @@ use smithay::{
reexports::wayland_server::{self, protocol::wl_surface::WlSurface, Resource},
wayland::compositor::{self, SurfaceData},
};
use std::{cell::RefCell, ffi::c_void, sync::Arc, time::Duration};
use std::{ffi::c_void, sync::Arc, time::Duration};
use stereokit_rust::{
material::{Material, Transparency},
shader::Shader,
@@ -121,7 +121,7 @@ impl CoreSurface {
let mapped = compositor::with_states(&wl_surface, |data| {
data.data_map
.get::<RendererSurfaceStateUserData>()
.map(|surface_states| surface_states.borrow().buffer().is_some())
.map(|surface_states| surface_states.lock().unwrap().buffer().is_some())
.unwrap_or(false)
});
@@ -135,7 +135,9 @@ impl CoreSurface {
let Some(renderer_surface_state) = data
.data_map
.get::<RendererSurfaceStateUserData>()
.map(RefCell::borrow)
.map(std::sync::Mutex::lock)
.map(Result::ok)
.flatten()
else {
return;
};