[Pommed-commits] [SCM] pommed - hotkeys handler for Apple laptops branch, master, updated. 1.27-3-gdd053bc

Julien BLACHE jb at jblache.org
Sun Aug 23 11:07:53 UTC 2009


The following commit has been merged in the master branch:
commit dd053bc27ace6d3e9ac1c9b97f39b79deb237368
Author: Henrik Rydberg <rydberg at euromail.se>
Date:   Sun Aug 16 17:13:19 2009 +0200

    avoid changing timer parameter semantics at run-time
    
    The idle timeout configuration parameter is given in seconds,
    and is read in seconds. However, during "parameter fixing",
    the unit is changed to the dimensionless quantity "number of
    times larger than a timer tick". This patch removes the run-time
    change of the semantics, adjusting the logic accordingly.
    
    Signed-off-by: Henrik Rydberg <rydberg at euromail.se>

diff --git a/pommed/conffile.c b/pommed/conffile.c
index 9caf89f..d54b9e2 100644
--- a/pommed/conffile.c
+++ b/pommed/conffile.c
@@ -225,7 +225,7 @@ config_print(void)
   printf("    auto on threshold: %d\n", kbd_cfg.on_thresh);
   printf("    auto off threshold: %d\n", kbd_cfg.off_thresh);
   printf("    auto enable: %s\n", (kbd_cfg.auto_on) ? "yes" : "no");
-  printf("    idle timer: %d%s\n", (kbd_cfg.idle * KBD_TIMEOUT) / 1000, (kbd_cfg.idle > 0) ? "s" : "");
+  printf("    idle timer: %d%s\n", kbd_cfg.idle, (kbd_cfg.idle > 0) ? "s" : "");
   printf(" + CD eject:\n");
   printf("    enabled: %s\n", (eject_cfg.enabled) ? "yes" : "no");
   printf("    device: %s\n", eject_cfg.device);
diff --git a/pommed/kbd_auto.c b/pommed/kbd_auto.c
index 1e1222a..d513262 100644
--- a/pommed/kbd_auto.c
+++ b/pommed/kbd_auto.c
@@ -143,8 +143,8 @@ static void
 kbd_auto_process(int id, uint64_t ticks)
 {
   /* Increment keyboard backlight idle timer */
-  kbd_bck_info.idle++;
-  if ((kbd_cfg.idle > 0) && (kbd_bck_info.idle > kbd_cfg.idle))
+  kbd_bck_info.idle += KBD_TIMEOUT;
+  if ((kbd_cfg.idle > 0) && (kbd_bck_info.idle > 1000 * kbd_cfg.idle))
     kbd_backlight_inhibit_set(KBD_INHIBIT_IDLE);
 
   kbd_backlight_ambient_check();
diff --git a/pommed/mactel/kbd_backlight.c b/pommed/mactel/kbd_backlight.c
index 0d64cac..e9af5d9 100644
--- a/pommed/mactel/kbd_backlight.c
+++ b/pommed/mactel/kbd_backlight.c
@@ -284,7 +284,4 @@ kbd_backlight_fix_config(void)
 
   if (kbd_cfg.step > (KBD_BACKLIGHT_MAX / 2))
     kbd_cfg.step = KBD_BACKLIGHT_MAX / 2;
-
-  if (kbd_cfg.idle > 0)
-    kbd_cfg.idle = (kbd_cfg.idle * 1000) / KBD_TIMEOUT;
 }
diff --git a/pommed/pmac/kbd_backlight.c b/pommed/pmac/kbd_backlight.c
index 5e6ff49..f9bb133 100644
--- a/pommed/pmac/kbd_backlight.c
+++ b/pommed/pmac/kbd_backlight.c
@@ -379,9 +379,6 @@ kbd_backlight_fix_config(void)
 
   if (kbd_cfg.step > (KBD_BACKLIGHT_MAX / 2))
     kbd_cfg.step = KBD_BACKLIGHT_MAX / 2;
-
-  if (kbd_cfg.idle > 0)
-    kbd_cfg.idle = (kbd_cfg.idle * 1000) / KBD_TIMEOUT;
 }
 
 

-- 
pommed - hotkeys handler for Apple laptops



More information about the Pommed-commits mailing list