GNOME Bugzilla – Bug 653287
Add methods to control the backlight on each output
Last modified: 2011-06-24 06:53:27 UTC
Created attachment 190544 [details] [review] initial (untested) patch for review We need this in gnome-settings-daemon for the power plugin. -- At the moment g-p-m duplicates a load of code that's already in gnome_rr. If I can add this functionality here, I can remove about 2k lines from the power plugin patch. Bastien thinks it's a good idea. Patch is for initial review, basically for feedback. If you like the idea and method names, then I can fixup the obvious error problems and add some gtk-doc stuff. Comments please. Thanks dude.
Review of attachment 190544 [details] [review]: Couple of API tweaks I guess. ::: libgnome-desktop/gnome-rr.c @@ +101,3 @@ gsize edid_size; char * connector_type; + guint backlight_min; You don't seem to have _any_ way to say "hey, I don't have an xbacklight". Calling gnome_rr_output_get_backlight_{min,max}() will return garbage if it's not there. Make it an int and return -1 for those? Add an _has_backlight() function? @@ +1403,3 @@ +static void +read_brightness_limits (GnomeRROutput *output) For something called "read*" I would expect an output to the function. "update_brightness_limits()" instead?
Go for it, with Bastien's changes. Would the public get_backlight_now() and set_backlight() benefit from a GError, for the "no backlight control here" case?
Pushed with all the suggested changes, thanks for the quick review guys.