electron/electron

[Bug]: 'suspend' and 'resume' events not emitted by powerMonitor

dorsta opened this issue · 4 comments

Preflight Checklist

Electron Version

25.9.8

What operating system are you using?

Ubuntu

Operating System Version

Ubuntu 22.04.4

What arch are you using?

x64

Last Known Working Electron version

No response

Expected Behavior

On suspending or resuming system powerMonitor emits 'suspend' or 'resume' event accordingly.

Actual Behavior

No event emitted.

Testcase Gist URL

No response

Additional Information

Similar issue as #7699

This was my bad. I was expecting screen locking to behave the same as suspending, but they are separate things. It would be cool if powerMonitor could handle screen-lock on Linux though.

Closing this issue.

After further investigation it became clear that powerMonitor is indeed not emitting 'suspend' or 'resume' events, but only when the environment is set to 'production'. When the environment is set to 'development' powerMonitor is emitting those events as expected.

Reopening this issue. Please help.

ckerr commented

@dorsta does this issue persist in Electron 30?

@ckerr Thanks for the reply. Unfortunately, I get the same result with Electron 30.0.3 - 'suspend' and 'resume' emitted in development, not production.