keyboard: use fallback layout if failing to load

This commit is contained in:
galister
2024-06-09 09:53:46 +09:00
parent 4abfa3c3ac
commit 59c0bc870c
3 changed files with 58 additions and 27 deletions

View File

@@ -68,10 +68,14 @@ where
app.screens.clear();
let data = if let Some(wl) = wl.as_mut() {
keymap = get_keymap_wl().ok();
keymap = get_keymap_wl()
.map_err(|f| log::warn!("Could not load keyboard layout: {}", f))
.ok();
crate::overlays::screen::create_screens_wayland(wl, app)?
} else {
keymap = get_keymap_x11().ok();
keymap = get_keymap_x11()
.map_err(|f| log::warn!("Could not load keyboard layout: {}", f))
.ok();
match crate::overlays::screen::create_screens_x11pw(app) {
Ok(data) => data,
Err(e) => {