GNOME Bugzilla – Bug 729500
Some fixes to backlight in power plugin
Last modified: 2014-05-05 14:32:43 UTC
The last patch avoids the slider in the status menu being 0 at startup, the other patches are minor
Created attachment 275798 [details] [review] power: simplify brightness changed signal generation We can use g_variant_new_parsed() for building the inner variant and for passing the interface string too (and we save one malloc)
Created attachment 275799 [details] [review] power: discretize the set backlight value Most firmware backlight devices only allow a limited number of backlight settings (around 10 or 15), but we previously sometime failed to map the value from outside onto the discrete set of allowed percentages.
Created attachment 275800 [details] [review] power: signal a backlight change after initializing the rrscreen Similar to what we do for the kbd backlight, send a fake backlight changed event, to avoid the case when we get a dbus call from gnome-shell before we initialized, causing the slider in the menu to be 0 until the next change.
Review of attachment 275798 [details] [review]: Need to remove the string variable now though.
Review of attachment 275799 [details] [review]: I hate that code.
Review of attachment 275800 [details] [review]: Looks good.
Pushed with the noted change. Attachment 275798 [details] pushed as 1a763e6 - power: simplify brightness changed signal generation Attachment 275799 [details] pushed as cb655c9 - power: discretize the set backlight value Attachment 275800 [details] pushed as 590fe67 - power: signal a backlight change after initializing the rrscreen