WebKit Bugzilla
Attachment 361680 Details for
Bug 194500
: [WPE][GTK] Sleep disabler code should inhibit idle when a "System" sleep disabler is requested
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-194500-20190211102215.patch (text/plain), 3.31 KB, created by
Michael Catanzaro
on 2019-02-11 08:22:17 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Michael Catanzaro
Created:
2019-02-11 08:22:17 PST
Size:
3.31 KB
patch
obsolete
>Subversion Revision: 241240 >diff --git a/Source/WebCore/PAL/ChangeLog b/Source/WebCore/PAL/ChangeLog >index 3c0ef8449b208e0f6a8a9b6b708f9b71ba7cb4d1..0486a97c46c694a0854865d32ca5838aeba97fca 100644 >--- a/Source/WebCore/PAL/ChangeLog >+++ b/Source/WebCore/PAL/ChangeLog >@@ -1,3 +1,27 @@ >+2019-02-11 Michael Catanzaro <mcatanzaro@igalia.com> >+ >+ [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 NOBODY (OOPS!). >+ >+ 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): >+ > 2019-02-08 Myles C. Maxfield <mmaxfield@apple.com> > > [Cocoa] Ask platform for generic font family mappings >diff --git a/Source/WebCore/PAL/pal/system/glib/SleepDisablerGLib.cpp b/Source/WebCore/PAL/pal/system/glib/SleepDisablerGLib.cpp >index 1e872ff56829d517ae878d572416d2f524bffb71..6f922e118afdfc8355a85c184cc7ef2bad355244 100644 >--- a/Source/WebCore/PAL/pal/system/glib/SleepDisablerGLib.cpp >+++ b/Source/WebCore/PAL/pal/system/glib/SleepDisablerGLib.cpp >@@ -41,15 +41,13 @@ SleepDisablerGLib::SleepDisablerGLib(const char* reason, Type type) > , m_cancellable(adoptGRef(g_cancellable_new())) > , m_reason(reason) > { >- // 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. >- if (type != SleepDisabler::Type::Display) >- return; >+ // We ignore Type because we always want to inhibit both screen lock and >+ // suspend, but only when idle. There is no reason for WebKit to ever block >+ // a user from manually suspending the computer, so inhibiting idle >+ // suffices. There's also probably no good reason for code taking a sleep >+ // disabler to differentiate between lock and suspend on our platform. If we >+ // ever need this distinction, which seems unlikely, then we'll need to >+ // audit all use of SleepDisabler. > > // First, try to use the ScreenSaver API. > g_dbus_proxy_new_for_bus(G_BUS_TYPE_SESSION, static_cast<GDBusProxyFlags>(G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES | G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS),
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 194500
: 361680