mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2026-04-03 07:15:44 -04:00
fix: if the progress not the child of main, not assume it is stop
This commit is contained in:
parent
49cb5a9d7e
commit
7ccbeae8b8
1 changed files with 6 additions and 3 deletions
|
|
@ -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);
|
wl_client_get_credentials(c->surface.xdg->client->client, &pid, NULL, NULL);
|
||||||
if (waitid(P_PID, pid, &in, WNOHANG | WCONTINUED | WSTOPPED | WNOWAIT) <
|
if (waitid(P_PID, pid, &in, WNOHANG | WCONTINUED | WSTOPPED | WNOWAIT) <
|
||||||
0) {
|
0) {
|
||||||
/* This process is not our child process, while is very unlikely that
|
/* This process is not our child process. We cannot determine its
|
||||||
* it is stopped, in order to do not skip frames assume that it is. */
|
* stopped state; assume it is not stopped to avoid blocking frame skip.
|
||||||
|
*/
|
||||||
if (errno == ECHILD)
|
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) {
|
} else if (in.si_pid) {
|
||||||
if (in.si_code == CLD_STOPPED || in.si_code == CLD_TRAPPED)
|
if (in.si_code == CLD_STOPPED || in.si_code == CLD_TRAPPED)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue