fix(camera,sms,dwm): fix CAMSS AXI frame-boundary stop, SMS draft button label, and post-reboot softkey responsiveness

This commit is contained in:
Luxferre
2026-10-21 16:00:41 +03:00
parent 55b20c5b85
commit 4bb95d42b0
26 changed files with 152 additions and 33 deletions
+37 -5
View File
@@ -1537,8 +1537,15 @@ static long long
read_softkey_suppress(void)
{
char buf[32];
long long now = dwm_now_ms();
if (softkey_suppress_until_ms > now + 5000LL)
softkey_suppress_until_ms = 0;
read_sysfs_str("/tmp/sxmo_softkey_suppress", buf, sizeof(buf));
long long v = atoll(buf);
if (v > now + 5000LL) {
unlink("/tmp/sxmo_softkey_suppress");
v = 0;
}
if (v > softkey_suppress_until_ms)
softkey_suppress_until_ms = v;
return softkey_suppress_until_ms;
@@ -1610,13 +1617,30 @@ host_spawn_command(const char *const *argv)
static int
is_plugin_daemon_alive(const char *plugin_name)
{
char pidpath[128], buf[32];
char pidpath[128], buf[256];
snprintf(pidpath, sizeof(pidpath), "/tmp/dwm_plugin_%s.pid", plugin_name);
read_sysfs_str(pidpath, buf, sizeof(buf));
int pid = atoi(buf);
return (pid > 0 && kill(pid, 0) == 0);
if (pid <= 0 || kill(pid, 0) != 0)
return 0;
snprintf(pidpath, sizeof(pidpath), "/proc/%d/cmdline", pid);
int fd = open(pidpath, O_RDONLY | O_CLOEXEC);
if (fd < 0)
return 0;
ssize_t n = read(fd, buf, sizeof(buf) - 1);
close(fd);
if (n <= 0)
return 0;
for (ssize_t i = 0; i < n; i++) {
if (buf[i] == '\0')
buf[i] = ' ';
}
buf[n] = '\0';
return (strstr(buf, "dwm-plugin") != NULL && strstr(buf, plugin_name) != NULL);
}
static int preload_stagger_idx = 0;
static void
host_spawn_plugin(const char *plugin_name, const char *arg)
{
@@ -1625,9 +1649,15 @@ host_spawn_plugin(const char *plugin_name, const char *arg)
if (arg && strcmp(arg, "--preload") == 0) {
if (is_plugin_daemon_alive(plugin_name))
return;
const char *cmd[4] = { "dwm-plugin", plugin_name, "--preload", NULL };
Arg a = { .v = cmd };
spawn(&a);
int stagger_ms = 600 + (preload_stagger_idx++ * 220);
if (fork() == 0) {
if (dpy)
close(ConnectionNumber(dpy));
setsid();
usleep((useconds_t)stagger_ms * 1000U);
execlp("dwm-plugin", "dwm-plugin", plugin_name, "--preload", (char *)NULL);
_exit(EXIT_SUCCESS);
}
return;
}
XUngrabKeyboard(dpy, CurrentTime);
@@ -2677,6 +2707,8 @@ setup(void)
lidfd = open("/dev/input/by-path/platform-gpio-keys-event", O_RDONLY | O_NONBLOCK | O_CLOEXEC);
if (lidfd < 0)
lidfd = open("/dev/input/event0", O_RDONLY | O_NONBLOCK | O_CLOEXEC);
unlink("/tmp/sxmo_softkey_suppress");
unlink("/tmp/sxmo_softkey_state");
load_plugins();
grabkeys();
focus(NULL);