Use new WinAPI to implement wakelock on Windows
Categories
(Core :: Audio/Video, task, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox81 | --- | fixed |
People
(Reporter: alwu, Assigned: alwu, NeedInfo)
References
(Blocks 1 open bug)
Details
Attachments
(3 files)
This bug is a follow-up for bug1584319 where the reporter still encouter an issue where firefox can't prevent computer from sleeping correctly.
I guess using new API [1] to replace the current one we use [2] would probably help.
[1] https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-powersetrequest
[2] https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-setthreadexecutionstate
Assignee | ||
Comment 1•6 months ago
|
||
Assignee | ||
Comment 2•6 months ago
|
||
Assignee | ||
Comment 3•6 months ago
|
||
Updated•6 months ago
|
Assignee | ||
Comment 4•6 months ago
|
||
Here is the final version of Firefox with fix [1], feel free to try it to see if it works for you.
Nailed it at last! Congrats on the concerted effort. Looking forward to the fix in the general release. This case (hopefully) is closed.
Pushed by alwu@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/030d09ee2344 part1 : only use wakelock listener in chrome process. r=jmathies https://hg.mozilla.org/integration/autoland/rev/0ade1752db2e part2 : rename listener to legacy listener. r=jmathies https://hg.mozilla.org/integration/autoland/rev/fb4bcbf62691 part3 : implement a new wakelock listener with new API. r=jmathies
Comment 7•5 months ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/030d09ee2344
https://hg.mozilla.org/mozilla-central/rev/0ade1752db2e
https://hg.mozilla.org/mozilla-central/rev/fb4bcbf62691
Comment 8•2 months ago
|
||
There may be a new bug here. I have a pinned tab for Gmail. Someone messaged me on Hangouts, which played a sound on that Gmail tab, at around 6 P.M.. I locked my computer and went to bed around 10:30 P.M. without receiving any more messages in Hangouts. I woke up this morning to find that my computer had not gone to sleep last night. I checked powercfg
and discovered that FF had a request to prevent sleep. After some internet searches, I was led here. I checked powercfg
again, and Firefox was still holding a wake-lock. I closed that Gmail tab and checked powercfg
a third time, and Firefox had released the wake-lock.
I'm not sure where the disconnect broke down. Maybe it's Gmail's fault, e.g. once it starts playing a sound it doesn't release whatever flag/lock it holds that tells Firefox that it's done playing audio for now. But, either way, this is a disappointing experience.
FF: 82.0.3
Windows: Pro 10.0.19041
Assignee | ||
Comment 9•2 months ago
|
||
Hi, could you file a new bug for your issue and paste what you saw in powercfg
to the new bug? (and NI me on that bug)
It would be great to use a different bug to track new issue, instead of mixing all issues in the same bug.
Thank you so much.
Description
•