Monorepo for Aesthetic.Computer aesthetic.computer
4
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: wait for input devices before boot animation

evdev devices aren't ready when boot animation starts. Retry up to
20 times (2 seconds) until keyboard appears, so W install prompt works.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

+19 -13
+19 -13
fedac/native/src/ac-native.c
··· 1318 1318 ac_log("[boot-anim] no log_dev, show_install=1 (always offer)\n"); 1319 1319 } 1320 1320 1321 - // Open evdev fds once for key checking (avoid per-frame open/close) 1321 + // Open evdev fds for key checking — retry until devices appear 1322 1322 int key_fds[8]; 1323 1323 int key_fd_count = 0; 1324 - DIR *dir = opendir("/dev/input"); 1325 - if (dir) { 1326 - struct dirent *ent; 1327 - while ((ent = readdir(dir)) && key_fd_count < 8) { 1328 - if (strncmp(ent->d_name, "event", 5) != 0) continue; 1329 - char path[64]; 1330 - snprintf(path, sizeof(path), "/dev/input/%s", ent->d_name); 1331 - int fd = open(path, O_RDONLY | O_NONBLOCK); 1332 - if (fd >= 0) { 1333 - key_fds[key_fd_count++] = fd; 1334 - fprintf(stderr, "[boot-anim] opened %s (fd %d)\n", path, fd); 1324 + for (int retry = 0; retry < 20 && key_fd_count == 0; retry++) { 1325 + DIR *dir = opendir("/dev/input"); 1326 + if (dir) { 1327 + struct dirent *ent; 1328 + while ((ent = readdir(dir)) && key_fd_count < 8) { 1329 + if (strncmp(ent->d_name, "event", 5) != 0) continue; 1330 + char path[64]; 1331 + snprintf(path, sizeof(path), "/dev/input/%s", ent->d_name); 1332 + int fd = open(path, O_RDONLY | O_NONBLOCK); 1333 + if (fd >= 0) { 1334 + key_fds[key_fd_count++] = fd; 1335 + fprintf(stderr, "[boot-anim] opened %s (fd %d)\n", path, fd); 1336 + } 1335 1337 } 1338 + closedir(dir); 1336 1339 } 1337 - closedir(dir); 1340 + if (key_fd_count == 0) { 1341 + fprintf(stderr, "[boot-anim] no input devices yet, waiting... (%d/20)\n", retry + 1); 1342 + usleep(100000); // 100ms 1343 + } 1338 1344 } 1339 1345 fprintf(stderr, "[boot-anim] %d event devices\n", key_fd_count); 1340 1346