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 729500 - Some fixes to backlight in power plugin
Some fixes to backlight in power plugin
Status: RESOLVED FIXED
Product: gnome-settings-daemon
Classification: Core
Component: power
unspecified
Other All
: Normal normal
: ---
Assigned To: gnome-settings-daemon-maint
gnome-settings-daemon-maint
Depends on:
Blocks:
 
 
Reported: 2014-05-04 12:53 UTC by Giovanni Campagna
Modified: 2014-05-05 14:32 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
power: simplify brightness changed signal generation (1.39 KB, patch)
2014-05-04 12:53 UTC, Giovanni Campagna
committed Details | Review
power: discretize the set backlight value (3.89 KB, patch)
2014-05-04 12:53 UTC, Giovanni Campagna
committed Details | Review
power: signal a backlight change after initializing the rrscreen (1.55 KB, patch)
2014-05-04 12:53 UTC, Giovanni Campagna
committed Details | Review

Description Giovanni Campagna 2014-05-04 12:53:00 UTC
The last patch avoids the slider in the status menu being 0 at startup,
the other patches are minor
Comment 1 Giovanni Campagna 2014-05-04 12:53:04 UTC
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)
Comment 2 Giovanni Campagna 2014-05-04 12:53:11 UTC
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.
Comment 3 Giovanni Campagna 2014-05-04 12:53:16 UTC
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.
Comment 4 Bastien Nocera 2014-05-05 13:12:40 UTC
Review of attachment 275798 [details] [review]:

Need to remove the string variable now though.
Comment 5 Bastien Nocera 2014-05-05 13:17:24 UTC
Review of attachment 275799 [details] [review]:

I hate that code.
Comment 6 Bastien Nocera 2014-05-05 13:20:20 UTC
Review of attachment 275800 [details] [review]:

Looks good.
Comment 7 Giovanni Campagna 2014-05-05 14:32:28 UTC
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