emit a warning if apps don't recognize focus changes, instead of a panic

This commit is contained in:
bunnie 2022-04-03 17:49:12 +08:00
parent 66ca91dd6e
commit b936414d11

View file

@ -495,7 +495,8 @@ fn xmain() -> ! {
for switchers in authorized_switchers {
if let Some(auth_token) = context_mgr.find_app_token_by_name(switchers) {
if auth_token == switchapp.token {
context_mgr.notify_app_switch(new_app_token).expect("couldn't send focus swap notifications!");
context_mgr.notify_app_switch(new_app_token)
.unwrap_or_else(|_| {log::warn!("Application does not recognize focus changes")});
match context_mgr.activate(&gfx, &mut canvases, new_app_token, false) {
Ok(_) => (),
Err(_) => log::warn!("failed to switch to {}, silent error!", switchapp.app_name.as_str().unwrap()),