fix(sdk+launcher): 图标不渲染真根因(agent-219) — meow_ui_img.c scale_buf cover 采样把乘写成除(÷缩放比→采到源图左上角透明区,全丢); 改乘+居中裁剪偏移修正; 宿主旧测试用纯色图掩盖了该bug。+ main_menu App退出/结构变化重绘时 fb_pan_buf0_force 无条件pan回buffer0(防App翻页留buffer1致菜单残帧)

meow_ui.a→3e0ee8f7 launcher→9d0efc2f hello→9609ea6e files→90f5cf07 ncm→be8be221(均已上卡); 真机截图证据 .tmp/meowbug/fix1.png+fix_b2_after.png
This commit is contained in:
MeowOS committed 2026-08-31 15:42:24 +08:00
1 parent 05a19a9ea3
commit ab4da09e75
45 files changed
+1926 -147

No files matched your search

+69
View File
@@ -63,6 +63,14 @@ static void ams_send(const char *payload, int len)
close(fd);
}
/* 公开 amsd 上报通道包装(AMSD_DESIGN §6.2 二期):util.c 转发运行时 declare / picker
* call/result 给 amsd 用。语义与 ams_send 一致:best-effort、单次 connect+write+close、
* 失败静默丢(amsd 不在不影响 launcher)。 */
void meow_ams_send(const char *payload, int len)
{
ams_send(payload, len);
}
/* launch 上报:pkg/activity/chain/pid。amsd 建表项 + 开 stdout 会话。 */
static void ams_report_launch(const struct app *a, const char *chain, pid_t pid)
{
@@ -223,6 +231,54 @@ int meow_ams_kill_pending(const char *pkg)
return 1;
}
/* ---- AMSD_DESIGN §6.2 二期:picker 上下文(随 pending-start 置位,launch_app_chain 消费后清)----
* amsd `am picker` → MSG_AMS_START 扩载荷(picker=1)→ ipc_dispatch 经 set_ex 置位 + 武装
* g_ams_pick_armed;main_menu 消费 pending-start(照旧 launch_app/launch_activity)时,
* launch_app_chain 读到武装位 → 注入 MEOW_PICKER_ACTION/REQ_ID/CALLER 到子进程 → 解除武装。
* 单一写者(ipc_dispatch / launch_app_chain),且同一时刻仅一个 pending-start 在飞(v1 单前台 App),
* 故武装位不会错配到非 picker 启动。 */
static char g_ams_pick_action[24];
static char g_ams_pick_caller[MEOW_APP_ID_MAX];
static uint32_t g_ams_pick_req;
static int g_ams_pick_armed;
int meow_ams_pending_start_set_ex(const char *pkg, const char *act,
const char *pick_action, uint32_t pick_req,
const char *pick_caller)
{
int rc = meow_ams_pending_start_set(pkg, act);
if (rc != 0) return rc; /* 拒绝(有前台 App / 参数非法) */
g_ams_pick_action[0] = 0;
g_ams_pick_caller[0] = 0;
g_ams_pick_req = 0;
g_ams_pick_armed = 0;
if (pick_action && pick_action[0]) {
snprintf(g_ams_pick_action, sizeof g_ams_pick_action, "%s", pick_action);
if (pick_caller) snprintf(g_ams_pick_caller, sizeof g_ams_pick_caller, "%s", pick_caller);
g_ams_pick_req = pick_req;
g_ams_pick_armed = 1;
}
return 0;
}
/* 子进程 exec 前注入 picker env(action/req/caller 已由 launch_app_chain 入口捕获并解除全局武装,
* 即使启动失败不再错配到下一次普通启动)。返回注入后的 ne。 */
static int ams_push_picker_env(char **envp, int ne, const char *action,
uint32_t req, const char *caller)
{
if (!action || !action[0]) return ne;
/* envp 容量 48:此处 +3 仍在界内(见 launch_app_chain envp[48] 注释) */
static char e_act[40], e_req[40], e_caller[MEOW_APP_ID_MAX + 20];
snprintf(e_act, sizeof e_act, "MEOW_PICKER_ACTION=%s", action);
snprintf(e_req, sizeof e_req, "MEOW_PICKER_REQ_ID=%u", req);
snprintf(e_caller, sizeof e_caller, "MEOW_PICKER_CALLER=%s", caller ? caller : "");
envp[ne++] = e_act;
envp[ne++] = e_req;
envp[ne++] = e_caller;
logmsg("launch: picker env action=%s req=%u caller=%s", action, req, caller ? caller : "");
return ne;
}
/* ---- 阶段 D · M1:路由注册表辅助(主循环单写者,无锁)---- */
struct meow_acct *meow_acct_find(const char *app_id)
@@ -1179,6 +1235,17 @@ static int run_app_notif_overlay(struct app *a, pid_t pid)
static int launch_app_chain(struct app *a, const char *chain)
{
logmsg("launch: %s (%s) chain=\"%s\"", a->name, a->exec, chain ? chain : "");
/* §6.2 二期:入口即捕获 picker 上下文并解除全局武装——即便后续 exec 失败(!a->ok)返回,
* 武装位也已清,不会错配到下一次普通启动(单飞不泄漏)。 */
char pick_action[24] = "";
char pick_caller[MEOW_APP_ID_MAX] = "";
uint32_t pick_req = 0;
if (g_ams_pick_armed) {
snprintf(pick_action, sizeof pick_action, "%s", g_ams_pick_action);
snprintf(pick_caller, sizeof pick_caller, "%s", g_ams_pick_caller);
pick_req = g_ams_pick_req;
g_ams_pick_armed = 0;
}
if (!a->ok) { logmsg("launch blocked: exec not ok"); return -1; }
meow_nav_begin(a->id, chain); /* M3:冷启动/裸启动都以当前链深初始化导航栈(chain 空→depth 0) */
@@ -1369,6 +1436,8 @@ static int launch_app_chain(struct app *a, const char *chain)
envp[ne++] = env_chain;
logmsg("launch: M3 env %s / %s", env_act, env_chain);
}
/* AMSD_DESIGN §6.2 二期:picker handler 启动注入(捕获值来自 launch_app_chain 入口)。 */
ne = ams_push_picker_env(envp, ne, pick_action, pick_req, pick_caller);
envp[ne] = NULL;
execve(a->exec, argv, envp);
int e = errno;