fix: if the progress not the child of main, not assume it is stop

This commit is contained in:
DreamMaoMao 2026-02-15 14:08:12 +08:00
parent 7add8975e8
commit aa60936bc7

View file

@ -254,10 +254,13 @@ static inline int32_t client_is_stopped(Client *c) {
wl_client_get_credentials(c->surface.xdg->client->client, &pid, NULL, NULL);
if (waitid(P_PID, pid, &in, WNOHANG | WCONTINUED | WSTOPPED | WNOWAIT) <
0) {
/* This process is not our child process, while is very unlikely that
* it is stopped, in order to do not skip frames assume that it is. */
/* This process is not our child process. We cannot determine its
* stopped state; assume it is not stopped to avoid blocking frame skip.
*/
if (errno == ECHILD)
return 1;
return 0; // if not our child, assume not stopped
/* Other errors, also assume not stopped. */
return 0;
} else if (in.si_pid) {
if (in.si_code == CLD_STOPPED || in.si_code == CLD_TRAPPED)
return 1;