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 653287 - Add methods to control the backlight on each output
Add methods to control the backlight on each output
Status: RESOLVED FIXED
Product: gnome-desktop
Classification: Core
Component: libgnome-desktop
git master
Other Linux
: Normal enhancement
: ---
Assigned To: Desktop Maintainers
Desktop Maintainers
Depends on:
Blocks: 649470
 
 
Reported: 2011-06-23 22:29 UTC by Richard Hughes
Modified: 2011-06-24 06:53 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
initial (untested) patch for review (5.19 KB, patch)
2011-06-23 22:29 UTC, Richard Hughes
reviewed Details | Review

Description Richard Hughes 2011-06-23 22:29:41 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.
Comment 1 Bastien Nocera 2011-06-23 22:40:44 UTC
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?
Comment 2 Federico Mena Quintero 2011-06-23 23:06:12 UTC
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?
Comment 3 Richard Hughes 2011-06-24 06:53:27 UTC
Pushed with all the suggested changes, thanks for the quick review guys.