GNOME Bugzilla – Bug 720198
Fix battery key action
Last modified: 2013-12-16 13:23:00 UTC
Since the cleanup performed in bug #709736, the battery key action is broken, since it relied on the power plugin dbus interface that was removed too. In order to avoid adding back that much code, I suggest instead having an OSD interface with a Show method on the power plugin, so the media-keys plugin just triggers that. I'm attaching a couple of patches that do that
Created attachment 263920 [details] [review] power: Add DBus method to show the power level OSD This DBus call will indirectly request gnome-shell to show an OSD containing information about battery status.
Created attachment 263921 [details] [review] media-keys: Fix battery key handling Since commit 5bbe63ff22, the power plugin DBus interface doesn't have the properties that media-keys plugin expects here. So use the new Show() call on the .Power.OSD interface to resuscitate this functionality.
Review of attachment 263921 [details] [review]: I'd rather you used the "display device" in UPower 0.99.x instead. It shouldn't add much more code, and removes the need for power plugin changes.
Review of attachment 263920 [details] [review]: As per review for the media-keys patch, marking as rejected.
Created attachment 264086 [details] [review] media-keys: Fix battery key handling Since commit 5bbe63ff22, the power plugin DBus interface doesn't have the properties that media-keys plugin expects here. So keep an UPower display device to fetch icon/percentage for the OSD.
Review of attachment 264086 [details] [review]: ::: plugins/media-keys/gsd-media-keys-manager.c @@ +1929,1 @@ + if (manager->priv->composite_device == NULL) There should always be a composite device. g_return_if_fail (); would be appropriate here. @@ +1930,3 @@ return; + g_debug ("showing battery level OSD"); You'll need to get the type as well. If it's not UPS or battery, you shouldn't show anything because there's no battery to show state for.
Created attachment 264134 [details] [review] media-keys: Fix battery key handling Since commit 5bbe63ff22, the power plugin DBus interface doesn't have the properties that media-keys plugin expects here. So keep an UPower display device to fetch icon/percentage for the OSD.
Review of attachment 264134 [details] [review]: Looks good!
Attachment 264134 [details] pushed as 79ce853 - media-keys: Fix battery key handling