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 786569 - Night Light stays orange after overnight suspend
Night Light stays orange after overnight suspend
Status: RESOLVED FIXED
Product: gnome-settings-daemon
Classification: Core
Component: color
3.24.x
Other Linux
: Normal normal
: ---
Assigned To: Richard Hughes
gnome-settings-daemon-maint
Depends on:
Blocks:
 
 
Reported: 2017-08-21 14:09 UTC by Veron Rado
Modified: 2018-06-06 09:43 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
color: Cancel old smooth transition on color temperature change (1.11 KB, patch)
2018-03-16 17:41 UTC, Benjamin Berg
accepted-commit_now Details | Review
color: Add test to check that smooth transitions are cancelled (3.79 KB, patch)
2018-03-16 17:41 UTC, Benjamin Berg
accepted-commit_now Details | Review

Description Veron Rado 2017-08-21 14:09:06 UTC
Night Light stays orange after waking from sleep.
Turing it on or off etc. doesn't fix it.



Ubuntu GNOME 17.04
Kernel: 4.10.0-32-generic x86_64 (64 bit gcc: 6.3.0)
Gnome 3.24.2 (Gtk 3.22.11-0ubuntu3)
Graphics: Card: Advanced Micro Devices [AMD/ATI] Ellesmere [Radeon RX 470/480]
           Display Server: X.Org 1.19.3 driver
           GLX Renderer: Gallium 0.4 on AMD POLARIS10 (DRM 3.9.0 / 4.10.0-32-generic, LLVM 4.0.0)
           GLX Version: 3.0 Mesa 17.0.7 Direct Rendering: Yes





This was also reported on launchpad where others have the issue too.
https://bugs.launchpad.net/ubuntu/+source/gnome-settings-daemon/+bug/1686895
Comment 1 Veron Rado 2017-08-21 14:27:58 UTC
A workaround for this is to change the display resolution and then revert original resolution.
Comment 2 Bastien Nocera 2017-08-23 14:54:07 UTC
The Display panel just has a toggle, the code that implements it is in gnome-settings-daemon.
Comment 3 Alan 2017-08-26 10:54:24 UTC
I've noticed the same issue. Night light when set to automatic (not tested manual) will not change back in the morning once the sun is up.

I have automatic suspend turned _off_

Night light controls stop working as Veron describes.

The workaround does work.

--
Fedora 26
Kernel 4.12.5
GNOME 3.24.2
Comment 4 acfoltzer 2017-10-19 20:49:45 UTC
On Fedora 26 with GNOME 3.24.2, I get the same behavior, but the only workaround I've found seems to be restarting. Changing the resolution as suggested above did not work.
Comment 5 Tadej Janež 2018-03-09 07:43:22 UTC
I'm experiencing the same issue on Fedora 27 with gnome-settings-daemon-3.26.2-2.fc27.x86_64.

The workaround described in https://bugs.launchpad.net/ubuntu/+source/gnome-settings-daemon/+bug/1686895/comments/8 works for me:

Open Gnome "Settings", go to "Devices" -> "Color" and toggle the color management for the affected screen(s) off and on again.
Comment 6 Benjamin Berg 2018-03-16 17:41:50 UTC
Created attachment 369795 [details] [review]
color: Cancel old smooth transition on color temperature change

A smooth transition between two color temperatures might still be active
when the next color temperature is set. Cancel any pending transitions
in this case.

This possibly fixes issues where the colour temperature is stuck in
night mode even though it is daytime.
Comment 7 Benjamin Berg 2018-03-16 17:41:58 UTC
Created attachment 369796 [details] [review]
color: Add test to check that smooth transitions are cancelled
Comment 8 Benjamin Berg 2018-03-16 17:42:38 UTC
Could someone try whether the patch actually fixes the bug. It definitely fixes a possible race condition that might be causing this, but there could be further issues.
Comment 9 Yanko Kaneti 2018-05-29 16:18:07 UTC
Someone tried attachment 36795 [details] [review]  here https://bugzilla.redhat.com/show_bug.cgi?id=1564030 , apparently with success
Comment 10 Benjamin Berg 2018-05-30 07:38:06 UTC
Yanko, the link goes to some odd attachment. Did you mean attachment 369796 [details] [review] from this bug which cancels the smooth transition?

At this point, I believe we do have a second bug that is related to attaching a new monitor while the laptop is suspended. However, I have no clue where it is, a dbus-monitor log from a resume that exhibits the bug might be useful (I have personally never reproduced the issue).
Comment 11 Benjamin Berg 2018-05-30 07:40:48 UTC
Hmm, interesting, so the user reports that this specific bug was fixed by the patch. I really did not expect that to happen, but that would be really good news.
Comment 12 Yanko Kaneti 2018-05-30 08:34:21 UTC
Sorry for the typo. I meant attachment 369795 [details] [review]
Comment 13 Carlos Garnacho 2018-05-30 14:10:57 UTC
Review of attachment 369795 [details] [review]:

::: plugins/color/gsd-night-light.c
@@ +217,3 @@
         /* small jump */
         if (ABS (temperature - self->cached_temperature) < GSD_TEMPERATURE_MAX_DELTA) {
+                poll_smooth_destroy (self);

Could be more readable if we do this call right above the if() so it catches the big and small jump cases, and replace the one from poll_smooth_create() with a warning/assert checking that the idle is unset. But LGTM.
Comment 14 Carlos Garnacho 2018-05-30 14:12:06 UTC
Review of attachment 369796 [details] [review]:

Nice :), LGTM.
Comment 15 Benjamin Berg 2018-05-30 15:17:56 UTC
Thanks, committed to both master and stable with the changes!
Comment 16 Benjamin Berg 2018-06-05 12:21:53 UTC
We had a number of issues that were fixed recently. Most notable:

 * Cancelling of smooth color temperature transitions after an abrupt
   change happens. This has been reported to fix issues
   where one monitor has the wrong state after resuming.
   https://bugzilla.gnome.org/show_bug.cgi?id=786569
 * There was an issue in certain mutter versions which caused
   night light to only work on one monitor
   https://gitlab.gnome.org/GNOME/mutter/merge_requests/71

I am closing bugs now that look like duplicates of these issues. If you believe you are hitting a different bug, then please open a new issue on gitlab. Please note that some of these fixes are not yet part of a stable release. They will become available in gnome-settings-daemon 3.28.2.
Comment 17 Benjamin Berg 2018-06-06 09:43:32 UTC
OK, there are reports that the issue is less likely but persists. I opened

https://gitlab.gnome.org/GNOME/gnome-settings-daemon/issues/60

to track this.