diff --git a/apps/app-loader/src/main.rs b/apps/app-loader/src/main.rs index a62acc116..7fdb38853 100644 --- a/apps/app-loader/src/main.rs +++ b/apps/app-loader/src/main.rs @@ -87,7 +87,7 @@ fn main() -> ! { xous::send_message(spawn.cid, xous::Message::new_lend(1, buf, None, None)).expect("Couldn't send a message to spawn"); menu.add_item(MenuItem { name: load_app_req.name, - action_conn: Some(self_conn), + action_conn: Some(self_conn), action_opcode: Opcode::DispatchApp.to_u32().unwrap(), action_payload: gam::MenuPayload::Scalar([apps.len().try_into().unwrap(), 0, 0, 0]), close_on_select: true }); @@ -98,6 +98,7 @@ fn main() -> ! { let index = msg.body.scalar_message().expect("Not a scalar").arg1; if index < apps.len() { let name: xous_ipc::String<64> = apps[index]; + log::info!("Switching to app `{}'", name); gam.switch_to_app(name.as_ref(), auth).expect(&format!("Could not dispatch app `{}'", name)); } else { panic!("Unrecognized app index"); diff --git a/services/gam/src/main.rs b/services/gam/src/main.rs index 4b579ac31..adff48886 100644 --- a/services/gam/src/main.rs +++ b/services/gam/src/main.rs @@ -565,7 +565,7 @@ fn wrapped_main() -> ! { // set before the leaving state due to interior-mutability issues (see the block under the debug statement // titled "resolving visibility rules"). The fix is to simply not issue a context switch if it's the same app. // It saves CPU thrashing and also works around this problem. (see issue #145) - let authorized_switchers = vec![MAIN_MENU_NAME, ROOTKEY_MODAL_NAME, gam::STATUS_BAR_NAME]; + let authorized_switchers = [&[MAIN_MENU_NAME, ROOTKEY_MODAL_NAME, gam::STATUS_BAR_NAME], gam::EXPECTED_APP_CONTEXTS].concat().to_vec(); for switchers in authorized_switchers { if let Some(auth_token) = context_mgr.find_app_token_by_name(switchers) { if auth_token == switchapp.token {