[cinnamon-settings-daemon/f20] redo 3.9 patch for more gnome changes

leigh123linux leigh123linux at fedoraproject.org
Thu Aug 22 10:54:49 UTC 2013


commit 67b949306b9c5018bb46b3c1896362de43ee8e5a
Author: leigh123linux <leigh123linux at googlemail.com>
Date:   Thu Aug 22 11:54:33 2013 +0100

    redo 3.9 patch for more gnome changes

 cinnamon-settings-daemon.spec            |    5 +-
 cinnamon-settings-daemon_gnome_3.9.patch |  142 ++++++++++++++++++++++++++++-
 2 files changed, 141 insertions(+), 6 deletions(-)
---
diff --git a/cinnamon-settings-daemon.spec b/cinnamon-settings-daemon.spec
index c69a210..2791aaf 100644
--- a/cinnamon-settings-daemon.spec
+++ b/cinnamon-settings-daemon.spec
@@ -2,7 +2,7 @@
 
 Name:           cinnamon-settings-daemon
 Version:        1.0.0
-Release:        0.11.git%{_internal_version}%{?dist}
+Release:        0.12.git%{_internal_version}%{?dist}
 Summary:        The daemon sharing settings from CINNAMON to GTK+/KDE applications
 
 Group:          System Environment/Daemons
@@ -221,6 +221,9 @@ fi
 %{_libexecdir}/csd-test-xsettings
 
 %changelog
+* Thu Aug 22 2013 Leigh Scott <leigh123linux at googlemail.com> - 1.0.0-0.12.gitb8b57d9
+- redo 3.9 patch for more gnome changes
+
 * Thu Aug 22 2013 Leigh Scott <leigh123linux at googlemail.com> - 1.0.0-0.11.gitb8b57d9
 - rebuilt
 
diff --git a/cinnamon-settings-daemon_gnome_3.9.patch b/cinnamon-settings-daemon_gnome_3.9.patch
index a0e7aef..8135843 100644
--- a/cinnamon-settings-daemon_gnome_3.9.patch
+++ b/cinnamon-settings-daemon_gnome_3.9.patch
@@ -56,15 +56,147 @@
                          continue;
  
                  if (is_on (outputs[i]))
-@@ -2432,7 +2432,7 @@ get_primary_output (CsdPowerManager *man
+@@ -2431,10 +2431,8 @@
+                 goto out;
  
          for (i = 0; outputs[i] != NULL; i++) {
-                 if (gnome_rr_output_is_connected (outputs[i]) &&
+-                if (gnome_rr_output_is_connected (outputs[i]) &&
 -                    gnome_rr_output_is_laptop (outputs[i]) &&
-+                    gnome_rr_output_is_builtin_display (outputs[i]) &&
-                     gnome_rr_output_get_backlight_min (outputs[i]) >= 0 &&
-                     gnome_rr_output_get_backlight_max (outputs[i]) > 0) {
+-                    gnome_rr_output_get_backlight_min (outputs[i]) >= 0 &&
+-                    gnome_rr_output_get_backlight_max (outputs[i]) > 0) {
++                if (gnome_rr_output_is_builtin_display (outputs[i]) &&
++                    gnome_rr_output_get_backlight (outputs[i]) >= 0) {
                          output = outputs[i];
+                         break;
+                 }
+@@ -2585,8 +2583,7 @@
+         /* prefer xbacklight */
+         output = get_primary_output (manager);
+         if (output != NULL) {
+-                return gnome_rr_output_get_backlight (output,
+-                                                      error);
++                return gnome_rr_output_get_backlight (output);
+         }
+ 
+         /* fall back to the polkit helper */
+@@ -2606,12 +2603,10 @@
+         output = get_primary_output (manager);
+         if (output != NULL) {
+ 
+-                min = gnome_rr_output_get_backlight_min (output);
+-                max = gnome_rr_output_get_backlight_max (output);
+-                now = gnome_rr_output_get_backlight (output, error);
++                now = gnome_rr_output_get_backlight (output);
+                 if (now < 0)
+                         goto out;
+-                value = ABS_TO_PERCENTAGE (min, max, now);
++                value = ABS_TO_PERCENTAGE (0, 100, now);
+                 goto out;
+         }
+ 
+@@ -2630,36 +2625,18 @@
+ static gint
+ backlight_get_min (CsdPowerManager *manager)
+ {
+-        GnomeRROutput *output;
+-
+-        /* if we have no xbacklight device, then hardcode zero as sysfs
+-         * offsets everything to 0 as min */
+-        output = get_primary_output (manager);
+-        if (output == NULL)
+-                return 0;
+-
+-        /* get xbacklight value, which maybe non-zero */
+-        return gnome_rr_output_get_backlight_min (output);
++        return 0;
+ }
+ 
+ static gint
+ backlight_get_max (CsdPowerManager *manager, GError **error)
+ {
+-        gint value;
+         GnomeRROutput *output;
+ 
+         /* prefer xbacklight */
+         output = get_primary_output (manager);
+-        if (output != NULL) {
+-                value = gnome_rr_output_get_backlight_max (output);
+-                if (value < 0) {
+-                        g_set_error (error,
+-                                     CSD_POWER_MANAGER_ERROR,
+-                                     CSD_POWER_MANAGER_ERROR_FAILED,
+-                                     "failed to get backlight max");
+-                }
+-                return value;
+-        }
++        if (output != NULL)
++                return 100;
+ 
+         /* fall back to the polkit helper */
+         return  backlight_helper_get_value ("get-max-brightness", error);
+@@ -2701,19 +2678,8 @@
+ 
+         /* prefer xbacklight */
+         output = get_primary_output (manager);
+-        if (output != NULL) {
+-                min = gnome_rr_output_get_backlight_min (output);
+-                max = gnome_rr_output_get_backlight_max (output);
+-                if (min < 0 || max < 0) {
+-                        g_warning ("no xrandr backlight capability");
+-                        goto out;
+-                }
+-                discrete = PERCENTAGE_TO_ABS (min, max, value);
+-                ret = gnome_rr_output_set_backlight (output,
+-                                                     discrete,
+-                                                     error);
+-                goto out;
+-        }
++        if (output != NULL)
++                return gnome_rr_output_set_backlight (output, value, error);
+ 
+         /* fall back to the polkit helper */
+         max = backlight_helper_get_value ("get-max-brightness", error);
+@@ -2755,9 +2721,9 @@
+                                      gnome_rr_output_get_name (output));
+                         goto out;
+                 }
+-                min = gnome_rr_output_get_backlight_min (output);
+-                max = gnome_rr_output_get_backlight_max (output);
+-                now = gnome_rr_output_get_backlight (output, error);
++                min = 0;
++                max = 100;
++                now = gnome_rr_output_get_backlight (output);
+                 if (now < 0)
+                        goto out;
+                 step = BRIGHTNESS_STEP_AMOUNT (max - min + 1);
+@@ -2816,9 +2782,9 @@
+                                      gnome_rr_output_get_name (output));
+                         goto out;
+                 }
+-                min = gnome_rr_output_get_backlight_min (output);
+-                max = gnome_rr_output_get_backlight_max (output);
+-                now = gnome_rr_output_get_backlight (output, error);
++                min = 0;
++                max = 100;
++                now = gnome_rr_output_get_backlight (output);
+                 if (now < 0)
+                        goto out;
+                 step = BRIGHTNESS_STEP_AMOUNT (max - min + 1);
+@@ -2862,12 +2828,8 @@
+ 
+         /* prefer xbacklight */
+         output = get_primary_output (manager);
+-        if (output != NULL) {
+-                ret = gnome_rr_output_set_backlight (output,
+-                                                     value,
+-                                                     error);
+-                goto out;
+-        }
++        if (output != NULL)
++               return gnome_rr_output_set_backlight (output, value, error);
+ 
+         /* fall back to the polkit helper */
+         ret = backlight_helper_set_value ("set-brightness",
 --- a/plugins/xrandr/csd-xrandr-manager.c
 +++ b/plugins/xrandr/csd-xrandr-manager.c
 @@ -372,7 +372,7 @@ is_laptop (GnomeRRScreen *screen, GnomeR


More information about the scm-commits mailing list