configure Chat_UI to register Chat_App Name with gam

This commit is contained in:
nworbnhoj 2023-07-27 06:01:39 +10:00
parent 34334cb80a
commit e9f362907d
2 changed files with 6 additions and 2 deletions

View file

@ -18,6 +18,7 @@ pub struct Chat {
impl Chat {
pub fn new(
app_name: &str,
app_cid: Option<CID>,
opcode_post: Option<usize>,
opcode_event: Option<usize>,
@ -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<CID>,
opcode_post: Option<usize>,
opcode_event: Option<usize>,
@ -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;

View file

@ -56,6 +56,7 @@ pub(crate) struct Ui {
impl Ui {
pub(crate) fn new(
sid: xous::SID,
app_name: &str,
app_cid: Option<xous::CID>,
opcode_event: Option<usize>,
) -> 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,