Qt: faster app icons on start

Three things still held icons up:
- The app list was built on Qt's thread, so nothing on screen could paint
  (icons included) until every app was listed and labelled. HomeActivity
  now lists apps on its own thread and answers through Native.appList.
- Each icon was drawn, PNG-encoded in Java and decoded again in C++. Icons
  now cross as raw premultiplied RGBA, and drawn ones are kept in the cache
  dir, keyed by the app's last update, so a fresh start just reads them.
- The closed drawer made its icons at the same time as home. It now waits
  1.5s, or until it opens.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hiQsCq11CwCPnKPp9D
This commit is contained in:
Claude committed 2026-11-03 20:42:04 +00:00
1 parent 8abe104dda
commit 56a4ae4347
7 files changed
+115 -16

No files matched your search

+10 -3
View File
@@ -114,7 +114,8 @@ Window {
say("Brought over your home screen");
}
function loadApps() { setApps(Host.apps()); loading = false; dropGone(); }
function loadApps() { gotApps(Host.apps()) }
function gotApps(list) { setApps(list); loading = false; dropGone(); }
function setApps(list) {
const rows = {};
@@ -127,7 +128,7 @@ Window {
const g = Object.assign({}, iconGen);
for (const p of (packages || "").split(",")) if (p) g[p] = (g[p] || 0) + 1;
iconGen = g;
loadApps();
Host.requestApps();
if (sheet === "app") { sheet = ""; appSheetRow = -1; }
}
@@ -400,6 +401,7 @@ Window {
Connections {
target: Host
function onAppsChanged(packages) { root.reload(packages) }
function onAppsLoaded(list) { root.gotApps(list) }
function onHomePressed() { root.goHome() }
function onBackPressed() { root.back() }
function onWidgetAdded(id) { root.widgetAdded(id) }
@@ -418,11 +420,15 @@ Window {
function onLegacyHome(json) { root.importLegacy(json) }
}
// The drawer's icons load once home's have had a head start (or when it opens).
Timer { id: drawerWarm; interval: 1500 }
Component.onCompleted: {
loadHome();
setApps(Host.savedApps()); // icons and names show at once; the real list follows
Host.ready();
Qt.callLater(loadApps);
Host.requestApps();
drawerWarm.start();
}
// ---- view
@@ -783,6 +789,7 @@ Window {
homeSet: root.homeSet
loading: root.loading
iconGen: root.iconGen
warm: !drawerWarm.running
insetTop: root.insetTop
insetBottom: root.insetBottom
onEdgeChanged: root.cover()