Bug 194500 - [WPE][GTK] Sleep disabler code should inhibit idle when a "System" sleep disabler is requested
Summary: [WPE][GTK] Sleep disabler code should inhibit idle when a "System" sleep disa...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: WebKit Nightly Build
Hardware: PC Linux
: P2 Normal
Assignee: Michael Catanzaro
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-02-11 08:07 PST by Michael Catanzaro
Modified: 2019-02-12 01:30 PST (History)
5 users (show)

See Also:


Attachments
Patch (3.31 KB, patch)
2019-02-11 08:22 PST, Michael Catanzaro
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Catanzaro 2019-02-11 08:07:42 PST
Splitting this out of bug #18697, I see I wrote this comment when writing SleepDisablerGlib:

    // We don't support suspend ("System") inhibitors, only idle inhibitors.
    // To get suspend inhibitors, we'd need to use the fancy GNOME
    // SessionManager API, which requires registering as a client application,
    // which is not practical from the web process. Secondly, because the only
    // current use of a suspend inhibitor in WebKit,
    // HTMLMediaElement::shouldDisableSleep, is suspicious. There's really no
    // valid reason for WebKit to ever block suspend, only idle.

There are three things wrong with this comment:

 * Nowadays, GNOME suspends the computer automatically on inactivity, and we actually do want to prevent that.
 * Inhibiting idle does affect the autosuspend countdown. So the current code should prevent automatic suspend, just not manual suspend. (I think I stand by my comment that we do not want to inhibit normal suspend, since that would just be annoying.)
 * I don't know why I thought HTMLMediaElement::shouldDisableSleep was suspicious.

Anyway, I guess the behavior we want is to ignore the Type argument and just always inhibit idle. That is, treat type=System the same way we current treat type=Display. I couldn't decide which to do when I wrote this code, but in retrospect that would have been a better option.
Comment 1 Michael Catanzaro 2019-02-11 08:19:22 PST
(In reply to Michael Catanzaro from comment #0)
> Splitting this out of bug #18697

I meant bug #186971
Comment 2 Michael Catanzaro 2019-02-11 08:22:17 PST
Created attachment 361680 [details]
Patch
Comment 3 WebKit Commit Bot 2019-02-12 01:29:52 PST
Comment on attachment 361680 [details]
Patch

Clearing flags on attachment: 361680

Committed r241290: <https://trac.webkit.org/changeset/241290>
Comment 4 WebKit Commit Bot 2019-02-12 01:29:54 PST
All reviewed patches have been landed.  Closing bug.