[WPE][GTK] Sleep disabler code should inhibit idle when a "System" sleep disabler...
authormcatanzaro@igalia.com <mcatanzaro@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 12 Feb 2019 09:29:46 +0000 (09:29 +0000)
committermcatanzaro@igalia.com <mcatanzaro@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 12 Feb 2019 09:29:46 +0000 (09:29 +0000)
commit25a7ab3611c7a017b6e3f07741c5e1e8ab0fde0d
treeca9524795cb4c82fdd32f28a968fce013003ee8b
parentc361ca11dd93642a851cb7038fb75cbce0b32f4c
[WPE][GTK] Sleep disabler code should inhibit idle when a "System" sleep disabler is requested
https://bugs.webkit.org/show_bug.cgi?id=194500

Reviewed by Carlos Garcia Campos.

There are three things wrong with the comment at the top of SleepDisablerGLib's constructor:

(1) Nowadays, GNOME suspends the computer automatically on inactivity, and we actually do
    want to prevent that.

(2) 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.)

(3) I don't know why I thought HTMLMediaElement::shouldDisableSleep was suspicious.

Anyway, 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.

* pal/system/glib/SleepDisablerGLib.cpp:
(PAL::SleepDisablerGLib::SleepDisablerGLib):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241290 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/PAL/ChangeLog
Source/WebCore/PAL/pal/system/glib/SleepDisablerGLib.cpp