Merge lp:~kamalmostafa/ubuntu/oneiric/gnome-settings-daemon/bug-827517 into lp:ubuntu/oneiric/gnome-settings-daemon

Proposed by Kamal Mostafa
Status: Merged
Merge reported by: Luke Yelavich
Merged at revision: not available
Proposed branch: lp:~kamalmostafa/ubuntu/oneiric/gnome-settings-daemon/bug-827517
Merge into: lp:ubuntu/oneiric/gnome-settings-daemon
Diff against target: 46 lines (+26/-0)
3 files modified
debian/changelog (+7/-0)
debian/patches/50_fix_brightness_step.patch (+18/-0)
debian/patches/series (+1/-0)
To merge this branch: bzr merge lp:~kamalmostafa/ubuntu/oneiric/gnome-settings-daemon/bug-827517
Reviewer Review Type Date Requested Status
Ubuntu branches Pending
Review via email: mp+71784@code.launchpad.net

Description of the change

The BRIGHTNESS_STEP_AMOUNT macro calculates a bogus value when called
as BRIGHTNESS_STEP_AMOUNT(max - min + 1) due to missing parentheses.

This simple patch fixes the macro.

To post a comment you must log in.
Revision history for this message
Jani Monoses (jani) wrote :

Hello, was this fix submitted upstream?

Revision history for this message
Kamal Mostafa (kamalmostafa) wrote :

Hi Jani- No, I have not submitted it upstream. I'd be grateful if the Ubuntu gnome3 folks would submit it on my behalf; if that's not possible I will submit it, but please don't hold off applying this obvious and necessary fix to Ubuntu -- we need this fix in Oneiric (see bugs 827517 and 568611).

Revision history for this message
Luke Yelavich (themuso) wrote :

Merged in the lp:~ubuntu-desktop/gnome-settings-daemon/ubuntu packaging branch.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2011-08-16 10:31:48 +0000
3+++ debian/changelog 2011-08-16 22:16:25 +0000
4@@ -1,3 +1,10 @@
5+gnome-settings-daemon (3.1.5-0ubuntu2) oneiric; urgency=low
6+
7+ * debian/patches/50_fix_brightness_step.patch
8+ - fix the broken BRIGHTNESS_STEP_AMOUNT macro (LP: #827517)
9+
10+ -- Kamal Mostafa <kamal@canonical.com> Mon, 15 Aug 2011 16:50:45 -0700
11+
12 gnome-settings-daemon (3.1.5-0ubuntu1) oneiric; urgency=low
13
14 * New upstream release
15
16=== added file 'debian/patches/50_fix_brightness_step.patch'
17--- debian/patches/50_fix_brightness_step.patch 1970-01-01 00:00:00 +0000
18+++ debian/patches/50_fix_brightness_step.patch 2011-08-16 22:16:25 +0000
19@@ -0,0 +1,18 @@
20+Description: fix BRIGHTESS_STEP_AMOUNT calculation macro
21+Author: Kamal Mostafa <kamal@canonical.com>
22+Bug-Ubuntu: https://launchpad.net/bugs/827517
23+
24+The BRIGHTNESS_STEP_AMOUNT macro calculates a bogus value when called
25+as BRIGHTNESS_STEP_AMOUNT(max - min + 1) due to missing parentheses.
26+
27+--- gnome-settings-daemon-3.1.4.orig/plugins/power/gsd-power-manager.c
28++++ gnome-settings-daemon-3.1.4/plugins/power/gsd-power-manager.c
29+@@ -121,7 +121,7 @@ static const gchar introspection_xml[] =
30+ "</node>";
31+
32+ /* on ACPI machines we have 4-16 levels, on others it's ~150 */
33+-#define BRIGHTNESS_STEP_AMOUNT(max) (max < 20 ? 1 : max / 20)
34++#define BRIGHTNESS_STEP_AMOUNT(max) ((max) < 20 ? 1 : (max) / 20)
35+
36+ /* take a discrete value with offset and convert to percentage */
37+ #define ABS_TO_PERCENTAGE(min, max, value) (((value - min) * 100) / (max - min))
38
39=== modified file 'debian/patches/series'
40--- debian/patches/series 2011-08-15 10:14:05 +0000
41+++ debian/patches/series 2011-08-16 22:16:25 +0000
42@@ -6,3 +6,4 @@
43 40_xres_lcddefault.patch
44 42_onlyshowin_unity.patch
45 43_disable_locale_settings.patch
46+50_fix_brightness_step.patch

Subscribers

People subscribed via source and target branches

to all changes: