mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2026-02-20 01:40:18 -05: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);
|
||||
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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue