diff --git a/libs/chat/src/lib.rs b/libs/chat/src/lib.rs index 1f13541ff..fb05ccf5f 100644 --- a/libs/chat/src/lib.rs +++ b/libs/chat/src/lib.rs @@ -18,6 +18,7 @@ pub struct Chat { impl Chat { pub fn new( + app_name: &str, app_cid: Option, opcode_post: Option, opcode_event: Option, @@ -25,6 +26,7 @@ impl Chat { ) -> Self { let chat_sid = xous::create_server().unwrap(); let chat_cid = xous::connect(chat_sid).unwrap(); + let app_name = app_name.to_string(); log::info!("Starting chat UI server",); thread::spawn({ @@ -132,6 +134,7 @@ impl Chat { pub fn server( sid: SID, + app_name: &str, app_cid: Option, opcode_post: Option, opcode_event: Option, @@ -146,7 +149,7 @@ pub fn server( // let mut opcode_event = opcode_event; // let mut opcode_rawkeys = opcode_rawkeys; - let mut ui = ui::Ui::new(sid, app_cid, opcode_event); + let mut ui = ui::Ui::new(sid, app_name, app_cid, opcode_event); let mut user_post = true; let mut allow_redraw = false; diff --git a/libs/chat/src/ui.rs b/libs/chat/src/ui.rs index 2439206b9..f19de62a6 100644 --- a/libs/chat/src/ui.rs +++ b/libs/chat/src/ui.rs @@ -56,6 +56,7 @@ pub(crate) struct Ui { impl Ui { pub(crate) fn new( sid: xous::SID, + app_name: &str, app_cid: Option, opcode_event: Option, ) -> Self { @@ -64,7 +65,7 @@ impl Ui { let token = gam .register_ux(UxRegistration { - app_name: xous_ipc::String::<128>::from_str(SERVER_NAME_CHAT), + app_name: xous_ipc::String::<128>::from_str(app_name), ux_type: gam::UxType::Chat, predictor: Some(xous_ipc::String::<64>::from_str( ime_plugin_shell::SERVER_NAME_IME_PLUGIN_SHELL,