After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 792209 - Keep screen off while screensaver is on when adding inhibitors
Keep screen off while screensaver is on when adding inhibitors
Status: RESOLVED FIXED
Product: gnome-settings-daemon
Classification: Core
Component: power
unspecified
Other All
: Normal normal
: ---
Assigned To: gnome-settings-daemon-maint
gnome-settings-daemon-maint
Depends on:
Blocks:
 
 
Reported: 2018-01-04 16:27 UTC by Benjamin Berg
Modified: 2018-01-15 16:25 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
power: Keep screen off while screensaver is on when adding inhibitors (1.32 KB, patch)
2018-01-04 16:27 UTC, Benjamin Berg
none Details | Review
power: Add test that inhibitors don't unblank the screensaver (2.54 KB, patch)
2018-01-04 16:27 UTC, Benjamin Berg
committed Details | Review
power: Keep screen off while screensaver is on when adding inhibitors (1.51 KB, patch)
2018-01-11 17:35 UTC, Benjamin Berg
committed Details | Review

Description Benjamin Berg 2018-01-04 16:27:40 UTC
If an application adds an idle inhibitor and the screensaver is already on then GSD will currently unblank the screen. This is pointless, as the session is locked and the screen just shows black.

One case where this happens is if Firefox starts playing a sound in a tab while the screen is locked.
Comment 1 Benjamin Berg 2018-01-04 16:27:45 UTC
Created attachment 366309 [details] [review]
power: Keep screen off while screensaver is on when adding inhibitors

When a new idle inhibitor is added then the state needs to be
reconfigured. This would also happen if the screen is already turned off
because the screensaver is active.
Comment 2 Benjamin Berg 2018-01-04 16:27:56 UTC
Created attachment 366310 [details] [review]
power: Add test that inhibitors don't unblank the screensaver
Comment 3 Bastien Nocera 2018-01-11 14:24:05 UTC
Review of attachment 366309 [details] [review]:

::: plugins/power/gsd-power-manager.c
@@ +1722,2 @@
         /* are we inhibited from going idle */
+        if (!manager->priv->session_is_active || (is_idle_inhibited && !manager->priv->screensaver_active)) {

Can you please add a linefeed after "||"

@@ +1722,3 @@
         /* are we inhibited from going idle */
+        if (!manager->priv->session_is_active || (is_idle_inhibited && !manager->priv->screensaver_active)) {
+                if (is_idle_inhibited && !manager->priv->screensaver_active)

You might want to split this up so that the debug messages are accurate.
Comment 4 Bastien Nocera 2018-01-11 14:26:52 UTC
Review of attachment 366310 [details] [review]:

Looks good.
Comment 5 Benjamin Berg 2018-01-11 17:35:56 UTC
Created attachment 366675 [details] [review]
power: Keep screen off while screensaver is on when adding inhibitors

When a new idle inhibitor is added then the state needs to be forced to
normal mode even when the user is idle. However, this should not happen
if the screensaver is active at the time.
Comment 6 Bastien Nocera 2018-01-12 13:07:34 UTC
Review of attachment 366675 [details] [review]:

Sure.
Comment 7 Benjamin Berg 2018-01-15 16:25:05 UTC
Attachment 366310 [details] pushed as 7f7af94 - power: Add test that inhibitors don't unblank the screensaver
Attachment 366675 [details] pushed as 75b331e - power: Keep screen off while screensaver is on when adding inhibitors