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 773402 - PATCH: gsd-power-manager: The Power.Keyboard.Brightness property is in percent
PATCH: gsd-power-manager: The Power.Keyboard.Brightness property is in percent
Status: RESOLVED FIXED
Product: gnome-settings-daemon
Classification: Core
Component: power
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gnome-settings-daemon-maint
gnome-settings-daemon-maint
Depends on:
Blocks: 773403
 
 
Reported: 2016-10-24 07:34 UTC by Hans de Goede
Modified: 2017-01-30 11:21 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
[PATCH 1/5] gsd-power-manager: s/upower_kdb_proxy/upower_kbd_proxy/ (4.85 KB, patch)
2016-10-24 07:34 UTC, Hans de Goede
none Details | Review
[PATCH 2/5] gsd-power-manager: deref upower_kbd_proxy on power_manager_stop() (1.02 KB, patch)
2016-10-24 07:35 UTC, Hans de Goede
none Details | Review
[PATCH 3/5] gsd-power-manager: The Power.Keyboard.Brightness property is in percent (3.28 KB, patch)
2016-10-24 07:36 UTC, Hans de Goede
none Details | Review
[PATCH 1/7] power: s/upower_kdb_proxy/upower_kbd_proxy/ (4.79 KB, patch)
2017-01-29 18:14 UTC, Hans de Goede
committed Details | Review
[PATCH 2/7] power: Free leaked UPower keyboard backlight proxy (965 bytes, patch)
2017-01-29 18:15 UTC, Hans de Goede
committed Details | Review
[PATCH 3/7] power: The Power.Keyboard.Brightness property is in percent (3.45 KB, patch)
2017-01-29 18:15 UTC, Hans de Goede
committed Details | Review
[PATCH 4/7] power: Make PERCENTAGE_TO_ABS round to the nearest value (2.78 KB, patch)
2017-01-29 18:16 UTC, Hans de Goede
committed Details | Review

Description Hans de Goede 2016-10-24 07:34:02 UTC
Created attachment 338317 [details] [review]
[PATCH 1/5] gsd-power-manager: s/upower_kdb_proxy/upower_kbd_proxy/

Fix get_other_property and 2 backlight_iface_emit_changed calls to properly report the brightness value in percent rather then reporting the abs value.
    
This fixes the "Keyboard Brightness" slider in the control-center power panel not working on e.g. my XPS 15.

Note the actual fix as described above is the 3th patch in the set of patches I'm attaching the other 2 (preparation) patches fix a typo and a small resource leak I noticed while working this.
Comment 1 Hans de Goede 2016-10-24 07:35:25 UTC
Created attachment 338318 [details] [review]
[PATCH 2/5] gsd-power-manager: deref upower_kbd_proxy on power_manager_stop()
Comment 2 Hans de Goede 2016-10-24 07:36:12 UTC
Created attachment 338319 [details] [review]
[PATCH 3/5] gsd-power-manager: The Power.Keyboard.Brightness property is in percent
Comment 3 Bastien Nocera 2016-10-24 10:57:31 UTC
Review of attachment 338317 [details] [review]:

Looks good.
Comment 4 Bastien Nocera 2016-10-24 11:00:09 UTC
Review of attachment 338318 [details] [review]:

> gsd-power-manager: deref upower_kbd_proxy on power_manager_stop()

power: Free leaked UPower keyboard backlight proxy
 
> Dereference upower_kbd_proxy on power_manager_stop().

Free.
 
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Please remove the SOB from all your patches though.
Comment 5 Bastien Nocera 2016-10-24 11:05:34 UTC
Review of attachment 338319 [details] [review]:

> gsd-power-manager: The Power.Keyboard.Brightness property is in percent

"power". Please also make sure to mention what is getting fixed in the commit subject. You're just summarising what's said below otherwise.

> control-center power panel

Power Settings panel, or gnome-control-center power panel.

> Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Please remove.
Comment 6 Hans de Goede 2017-01-29 18:13:42 UTC
Thanks for the reviews I'm attaching a new set of patches, addressing all review remarks.
Comment 7 Hans de Goede 2017-01-29 18:14:28 UTC
Created attachment 344489 [details] [review]
[PATCH 1/7] power: s/upower_kdb_proxy/upower_kbd_proxy/
Comment 8 Hans de Goede 2017-01-29 18:15:08 UTC
Created attachment 344490 [details] [review]
[PATCH 2/7] power: Free leaked UPower keyboard backlight proxy
Comment 9 Hans de Goede 2017-01-29 18:15:40 UTC
Created attachment 344491 [details] [review]
[PATCH 3/7] power: The Power.Keyboard.Brightness property is in percent
Comment 10 Hans de Goede 2017-01-29 18:16:12 UTC
Created attachment 344492 [details] [review]
[PATCH 4/7] power: Make PERCENTAGE_TO_ABS round to the nearest value
Comment 11 Bastien Nocera 2017-01-30 10:48:40 UTC
Review of attachment 344489 [details] [review]:

Great.

Don't forget to add the bug URL at the bottom of the commit message.
Comment 12 Bastien Nocera 2017-01-30 10:49:22 UTC
Review of attachment 344489 [details] [review]:

> power: s/upower_kdb_proxy/upower_kbd_proxy/

Please use the content of commit message body as the commit subject though.
Comment 13 Bastien Nocera 2017-01-30 10:55:24 UTC
Review of attachment 344490 [details] [review]:

Note, a couple of further fixes if you fancy:
- rename bus_cancellable to cancellable
- use ->cancellable in those kbd proxy calls
- use g_clear_object/_pointer when appropriate in _stop()

Would be nice if you could at least file a bug about those.

::: plugins/power/gsd-power-manager.c
@@ +2705,3 @@
         g_clear_object (&manager->priv->idle_monitor);
 
+        g_clear_object (&manager->priv->upower_kbd_proxy);

You can put this up on the line just below the g_clear_object() above.
Comment 14 Bastien Nocera 2017-01-30 10:56:59 UTC
Review of attachment 344491 [details] [review]:

Sure.
Comment 15 Bastien Nocera 2017-01-30 10:59:35 UTC
Review of attachment 344492 [details] [review]:

Don't forget the bug link in the commit message.
Comment 16 Bastien Nocera 2017-01-30 11:21:11 UTC
With the nits fixed
Comment 17 Bastien Nocera 2017-01-30 11:21:55 UTC
(In reply to Bastien Nocera from comment #13)
> Review of attachment 344490 [details] [review] [review]:
> 
> Note, a couple of further fixes if you fancy:
> - rename bus_cancellable to cancellable
> - use ->cancellable in those kbd proxy calls
> - use g_clear_object/_pointer when appropriate in _stop()
> 
> Would be nice if you could at least file a bug about those.

I fixed those as well.