GNOME Bugzilla – Bug 771881
Low battery notification never refreshed (patch attached)
Last modified: 2019-03-20 11:36:58 UTC
Created attachment 336161 [details] [review] add patch connecting 2 more signals Currently, when a laptop goes low on battery, a notification pops up with a text: _("Approximately %s remaining (%.0f%%)"), remaining_text, percentage); However, this text is only refreshed when the battery status change of type (goes to critical, etc.). This is a problem since usually this notification appears when it remains 20 minutes and change to critical at 5 minutes left. During 15 minutes you will get a "Approximately 20 minutes" remaining while it's actually not. Since the notification use the remaining time and percentage of available battery, I would advise to connect such signals as well so that notification is always up-to-date with system information.
Created attachment 336259 [details] [review] add patch connecting 2 more signals (v2) Actually instead of closing/creating notifications, it's better to directly update the existing one if possible. This avoid having a transitional fade-out/fade-in when notification must be refreshed. Also in case of a user already dismissed notification, we should not present the notification again.
Created attachment 336892 [details] [review] patch connecting 2 more signals (v3) Re-indenting properly.
Is there anything left I can do to help solving that issue?
Hope to have it reviewed before next GNOME release! :)
Should I change product to gnome-shell? Shall I contact maintainers by any specific mean?
No, you just need to be patient.
Review of attachment 336892 [details] [review]: > power manager: refresh low-battery notifications when battery percentage or time remaining change "power: " not "power manager: " The line is too long. This also only fixes the problem for builtin batteries or UPSes, eg. batteries that power the system, not for devices that are running low. In any case, this would require much more changes than you've done so far. First, we need to make sure we have one "low" notification per device, that is 1 Notification for device_composite (laptop batteries and UPS) and one per device (mouse, keyboard, etc.). Then we can think of updating those individual notifications. ::: plugins/power/gsd-power-manager.c @@ +319,3 @@ { + if (*weak_pointer_location == NULL) { + NotifyNotification *notification; 8-spaces indentation, not 4. @@ +332,3 @@ + G_CALLBACK (on_notification_closed), NULL); + } else { + notify_notification_update(*weak_pointer_location, summary, body, icon_name); space before parenthesis. @@ +780,3 @@ + /* in case of data update, we want to refresh the notification only if user + did not already dismissed it*/ + if (manager->priv->notification_low != NULL) { This notification is shared by all devices, that is batteries powering the system, and batteries in wireless mice or keyboards. So there's no certainty that the "notification_low" notification will correspond to the same device you're receiving the update on.
*** Bug 770826 has been marked as a duplicate of this bug. ***
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gnome-settings-daemon/issues/305.