mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-04 04:27:34 +00:00
improve context swap debug messages
This commit is contained in:
parent
8d8dd2bd2f
commit
dca043d387
1 changed files with 8 additions and 8 deletions
|
|
@ -330,7 +330,7 @@ impl ContextManager {
|
|||
token: [u32; 4],
|
||||
clear: bool,
|
||||
) -> Result<(), xous::Error> {
|
||||
//log::set_max_level(log::LevelFilter::Trace);
|
||||
// log::set_max_level(log::LevelFilter::Trace);
|
||||
self.notify_app_switch(token).ok();
|
||||
|
||||
let mut leaving_visibility: bool = false;
|
||||
|
|
@ -438,7 +438,7 @@ impl ContextManager {
|
|||
token: context.gam_token,
|
||||
predictor_token: context.pred_token,
|
||||
};
|
||||
log::debug!("context gam token: {:?}, pred token: {:?}", context.gam_token, context.pred_token);
|
||||
log::debug!("context gam token: {:x?}, pred token: {:x?}", context.gam_token, context.pred_token);
|
||||
self.imef.connect_backend(descriptor).expect("couldn't connect IMEF to the current app");
|
||||
self.imef_active = true;
|
||||
} else {
|
||||
|
|
@ -467,7 +467,7 @@ impl ContextManager {
|
|||
// revert the keyboard vibe state
|
||||
self.kbd.set_vibe(context.vibe).expect("couldn't restore keyboard vibe");
|
||||
|
||||
log::trace!("raised focus to: {:?}", context);
|
||||
log::trace!("Raised focus to: {:?}", self.tm.lookup_name(&token));
|
||||
let last_token = context.app_token;
|
||||
self.last_context = self.focused_context;
|
||||
self.focused_context = Some(last_token);
|
||||
|
|
@ -494,7 +494,7 @@ impl ContextManager {
|
|||
self.redraw().expect("couldn't redraw the currently focused app");
|
||||
}
|
||||
}
|
||||
//log::set_max_level(log::LevelFilter::Info);
|
||||
// log::set_max_level(log::LevelFilter::Info);
|
||||
Ok(())
|
||||
}
|
||||
pub(crate) fn set_pred_api_token(&mut self, at: ApiToken) {
|
||||
|
|
@ -517,11 +517,11 @@ impl ContextManager {
|
|||
}
|
||||
}
|
||||
pub(crate) fn notify_app_switch(&self, new_app_token: [u32; 4]) -> Result<(), xous::Error> {
|
||||
log::trace!("notify app switch to {:?}", new_app_token);
|
||||
log::debug!("Foregrounding {:?} / {:x?}", self.tm.lookup_name(&new_app_token), new_app_token);
|
||||
if let Some(current_focus) = self.focused_context {
|
||||
if let Some(old_context) = self.get_context_by_token(current_focus) {
|
||||
if let Some(focuschange_id) = old_context.focuschange_id {
|
||||
log::trace!("Background focus change to {}, id {} / {:?}", old_context.listener, old_context.redraw_id, current_focus);
|
||||
log::debug!("Backgrounding {:?} (listener {}, id {} / {:x?})", self.tm.lookup_name(¤t_focus), old_context.listener, old_context.redraw_id, current_focus);
|
||||
xous::send_message(old_context.listener,
|
||||
xous::Message::new_scalar(focuschange_id as usize, gam::FocusState::Background as usize, 0, 0, 0)
|
||||
).map(|_| ())?;
|
||||
|
|
@ -534,7 +534,7 @@ impl ContextManager {
|
|||
|
||||
if let Some(new_context) = self.get_context_by_token(new_app_token) {
|
||||
if let Some(focuschange_id) = new_context.focuschange_id {
|
||||
log::trace!("Foreground focus change to {}, id {} / {:?}", new_context.listener, new_context.redraw_id, new_app_token);
|
||||
log::trace!("Foreground focus change to {:?} ({}, id {} / {:x?})", self.tm.lookup_name(&new_app_token), new_context.listener, new_context.redraw_id, new_app_token);
|
||||
xous::send_message(new_context.listener,
|
||||
xous::Message::new_scalar(focuschange_id as usize, gam::FocusState::Foreground as usize, 0, 0, 0)
|
||||
).map(|_| ())?;
|
||||
|
|
@ -547,7 +547,7 @@ impl ContextManager {
|
|||
pub(crate) fn redraw(&self) -> Result<(), xous::Error> { // redraws the currently focused context
|
||||
if let Some(token) = self.focused_app() {
|
||||
if let Some(context) = self.contexts.get(&token) {
|
||||
log::debug!("redraw msg to {}, id {}", context.listener, context.redraw_id);
|
||||
log::debug!("redraw msg to {:?} ({}, id {})", self.tm.lookup_name(&token), context.listener, context.redraw_id);
|
||||
let ret = match xous::try_send_message(context.listener,
|
||||
xous::Message::new_scalar(context.redraw_id as usize, 0, 0, 0, 0)
|
||||
) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue