fix(launcher): 字库启动竞态两连修 — ①卡就绪(热插拔轮询)后重扫字库 presets(开机早扫时卡未挂载只剩默认项,App 大字库声明落空→豆腐块)②扫描根目录不可读且仅默认项时不写 index(修开机覆盖掉卡上18条索引)

launcher b33da20a→9ae64777; test_font_tier PASS
This commit is contained in:
MeowOS committed 2026-08-31 11:12:55 +08:00
1 parent 8964cd1750
commit 3e414176c3
3 files changed
+9 -1

No files matched your search

+8 -1
View File
@@ -717,7 +717,14 @@ void meow_font_scan_presets_root(const char *card_root)
}
/* M2.58:扫描结果落盘为 <card_root>/MeowOS/config/fonts/index(含默认行 index0),
* 作为 SDK meow_font_get_available_count()/enumerate() 的持久数据源;无卡时仅默认 1 行,
* 由 meow_font_write_index 内部 mkdir-fail 静默放弃(此路径不刷屏)。 */
* 由 meow_font_write_index 内部 mkdir-fail 静默放弃(此路径不刷屏)。
* M2.82+ 修补:挂载点目录在无卡时也存在(mkdir 骗过 ENOENT 检查)→ 开机早扫曾把
* 卡上 18 条 index 覆盖成 1 条默认。故:fonts 根目录根本没打开(opendir 失败)且
* 只剩默认项时,判定为「卡在但字库目录不可读/未就绪」→ 不写 index,保留旧索引。 */
if (!d && font_presets_n <= 1) {
logmsg("fonts: scan root unavailable, keep existing index (%d presets in mem)", font_presets_n);
return;
}
meow_font_write_index(card_root);
}
+1
View File
@@ -898,6 +898,7 @@ static void run_menu(struct app apps[MAX_APPS], int napps, int state,
int was_nocard = (state == 1);
if (!mfont_ready && meow_font_ensure()) { dirty = 1; logmsg("hotplug: font loaded late"); }
if (mfont_ready) meow_font_reload_multifont(); /* M2.5x:卡挂载后重配多字体(此前无全局可配) */
meow_font_scan_presets(); /* M2.82+:卡就绪后重扫字库(启动时卡未挂载会只有默认项) */
if (was_nocard || state != 0 || napps == 0) {
struct app fresh[MAX_APPS];
int fn = scan_apps(fresh);
Binary file not shown.