fix: update shared state locking in sdxr_start to use shared_for_event_loop

This commit is contained in:
MayaTheShy
2025-11-08 21:51:41 -05:00
parent 65b302e337
commit 0e9bbec7dc

View File

@@ -323,7 +323,7 @@ pub extern "C" fn sdxr_start(app_id: *const std::os::raw::c_char) -> i32 {
let context = Context { dbus_connection, accent_color }; let context = Context { dbus_connection, accent_color };
// Use the shared_state Arc instead of creating a new BridgeState // Use the shared_state Arc instead of creating a new BridgeState
let mut projector = { let mut projector = {
let state_guard = shared_state.lock().unwrap(); let state_guard = shared_for_event_loop.lock().unwrap();
Projector::create(&*state_guard, &context, client.get_root().clone().as_spatial_ref(), "/".into()) Projector::create(&*state_guard, &context, client.get_root().clone().as_spatial_ref(), "/".into())
}; };
@@ -346,7 +346,7 @@ pub extern "C" fn sdxr_start(app_id: *const std::os::raw::c_char) -> i32 {
if frames.is_empty() { return; } if frames.is_empty() { return; }
// Lock shared_state and work with it // Lock shared_state and work with it
if let Ok(mut state) = shared_state.lock() { if let Ok(mut state) = shared_for_event_loop.lock() {
eprintln!("[bridge/event_loop] Processing {} frames, state has {} nodes", frames.len(), state.nodes.len()); eprintln!("[bridge/event_loop] Processing {} frames, state has {} nodes", frames.len(), state.nodes.len());
for frame in frames { for frame in frames {
state.on_frame(&frame); state.on_frame(&frame);