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 692559 - Unblank temporarily for urgent notifications
Unblank temporarily for urgent notifications
Status: RESOLVED FIXED
Product: gnome-settings-daemon
Classification: Core
Component: power
3.7.x
Other Linux
: Normal normal
: ---
Assigned To: Richard Hughes
gnome-settings-daemon-maint
Depends on:
Blocks: 681869
 
 
Reported: 2013-01-25 20:51 UTC by Bastien Nocera
Modified: 2013-02-13 15:36 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
power: Un-idle when receiving important notifications (1000 bytes, patch)
2013-01-27 16:23 UTC, Bastien Nocera
rejected Details | Review
power: Show notifications when about to suspend from idle (8.49 KB, patch)
2013-01-31 20:05 UTC, Bastien Nocera
none Details | Review
power: Show notifications when about to suspend from idle (8.49 KB, patch)
2013-01-31 20:05 UTC, Bastien Nocera
committed Details | Review
power: Wake up the display when about to suspend (878 bytes, patch)
2013-01-31 20:06 UTC, Bastien Nocera
none Details | Review
power: Wake up the display when about to logout (960 bytes, patch)
2013-02-13 15:34 UTC, Bastien Nocera
committed Details | Review

Description Bastien Nocera 2013-01-25 20:51:02 UTC
If urgent notifications come in, the shell should unidle so that the notification is visible.

This is useful for critical battery notifications, and "about to logout" notification (bug 597030), both of which can happen when the display is already blanked. This could also allow us to enable suspend by default (bug 681869).

[1]: I can provide a D-Bus interface for that, if you're averse to adding this in the shell codebase
Comment 1 Bastien Nocera 2013-01-27 14:18:04 UTC
Actually, as gnome-settings-daemon is responsible for the brightness, we really want it to be responsible for unblanking (resetting the idle would obviously mean that we reset the suspend counter, duh).

It might also be easier for gnome-shell to send a signal on the ScreenSaver D-Bus interface, for gnome-settings-daemon to unblank temporarily.
Comment 2 Bastien Nocera 2013-01-27 16:23:33 UTC
Created attachment 234543 [details] [review]
power: Un-idle when receiving important notifications
Comment 3 Bastien Nocera 2013-01-27 16:28:06 UTC
This is an example of the g-s-d code needed to handle a possible "ReceivedCriticalNotification" signal.
Comment 4 Jakub Steiner 2013-01-28 19:08:49 UTC
I hope we don't get too liberal with the urgent classification, but it does sound reasonable.
Comment 5 Bastien Nocera 2013-01-31 10:56:12 UTC
(In reply to comment #4)
> I hope we don't get too liberal with the urgent classification, but it does
> sound reasonable.

We already special-case urgent notifications in the shell.

Try disabling notifications in the user menu, and do:
notify-send -u normal "test" "test text"
(will not be shown)
notify-send -u critical "test" "test text"
(will be shown)

This is merely an expansion of that special-casing.
Comment 6 William Jon McCann 2013-01-31 17:00:48 UTC
Documenting what was said on IRC.

One purpose of the shield is to be able to wake up the screen (infrequently but periodically) to display notifications. We need to be careful about the frequency of wake ups so we don't waste power unnecessarily.

I'm not sure if the urgency of the notification should determine whether the notification is seen or not. I think if I opt-in to showing something on the lock screen it is already pretty important. And I'd rather not have app authors abusing the urgent flag to get special privileges.

Perhaps the urgency could be used to prioritize wakeups or bypass any frequency limits.
Comment 7 Bastien Nocera 2013-01-31 20:05:22 UTC
Created attachment 234931 [details] [review]
power: Show notifications when about to suspend from idle
Comment 8 Bastien Nocera 2013-01-31 20:05:42 UTC
Created attachment 234932 [details] [review]
power: Show notifications when about to suspend from idle
Comment 9 Bastien Nocera 2013-01-31 20:06:49 UTC
Created attachment 234933 [details] [review]
power: Wake up the display when about to suspend
Comment 10 Bastien Nocera 2013-01-31 20:15:16 UTC
The particular feature that I was looking at this gnome-shell change for is implementable directly in gnome-settings-daemon's power plugin, so we'll do that for now.

With those changes, you'll get the 1) a warning before suspending/hibernating 2) the display getting woken up for 10 seconds when this notification occurs. This should be good enough to allow us to enable suspend by default.

I'll commit this along with tests after 3.7.5.
Comment 11 Bastien Nocera 2013-02-13 15:33:30 UTC
Review of attachment 234543 [details] [review]:

This won't be needed.
Comment 12 Bastien Nocera 2013-02-13 15:34:51 UTC
Created attachment 235896 [details] [review]
power: Wake up the display when about to logout
Comment 13 Bastien Nocera 2013-02-13 15:35:22 UTC
Comment on attachment 234933 [details] [review]
power: Wake up the display when about to suspend

We don't want to wake up the display when the machine is going to go to sleep.
Comment 14 Bastien Nocera 2013-02-13 15:36:28 UTC
Attachment 234932 [details] pushed as 0a82672 - power: Show notifications when about to suspend from idle
Attachment 235896 [details] pushed as b7f2c72 - power: Wake up the display when about to logout