matchbox-panel: apply patch to stop wastefull battery polling, closes hh.org bug...
authorKoen Kooi <koen@openembedded.org>
Sun, 5 Feb 2006 10:47:57 +0000 (10:47 +0000)
committerOpenEmbedded Project <openembedded-devel@lists.openembedded.org>
Sun, 5 Feb 2006 10:47:57 +0000 (10:47 +0000)
packages/matchbox-panel/matchbox-panel-0.9.2/mb-applet-battery-repaint.patch [new file with mode: 0644]
packages/matchbox-panel/matchbox-panel_0.9.2.bb

diff --git a/packages/matchbox-panel/matchbox-panel-0.9.2/mb-applet-battery-repaint.patch b/packages/matchbox-panel/matchbox-panel-0.9.2/mb-applet-battery-repaint.patch
new file mode 100644 (file)
index 0000000..7d5c53f
--- /dev/null
@@ -0,0 +1,43 @@
+--- matchbox-panel-0.9.2/applets/mb-applet-battery.c.orig      2005-04-06 22:20:45.000000000 +0200
++++ matchbox-panel-0.9.2/applets/mb-applet-battery.c           2006-02-01 01:21:17.000000000 +0100
+@@ -200,23 +200,12 @@
+ void
+ paint_callback (MBTrayApp *app, Drawable drw )
+ {
+-
+-
+   int      power_pixels = 0;
+   unsigned char r = 0, g = 0, b = 0;
+   int      x, y;
+   int      bar_width, bar_height, bar_x, bar_y;
+   MBPixbufImage *img_backing = NULL;
+-  
+-
+-
+-
+-  while (!read_apm(apm_vals))
+-    usleep(50000L);
+-
+-  if (last_percentage == apm_vals[PERCENTAGE] && last_ac == apm_vals[AC_POWER])
+-    return;
+   img_backing = mb_tray_app_get_background (app, pb);
+@@ -409,10 +398,12 @@
+ }
+-void
+-timeout_callback ( MBTrayApp *app )
+-{
+-  mb_tray_app_repaint (app);
++void timeout_callback (MBTrayApp *app) {
++      while (!read_apm(apm_vals))
++              usleep(50000L);
++
++      if (last_percentage != apm_vals[PERCENTAGE] || last_ac != apm_vals[AC_POWER])
++              mb_tray_app_repaint (app);
+ }
+ void
index d0c208c..4c03769 100644 (file)
@@ -1,10 +1,11 @@
 include matchbox-panel.inc
 
-PR="r7"
+PR="r9"
 SRC_URI = "http://projects.o-hand.com/matchbox/sources/${PN}/0.9/${PN}-${PV}.tar.gz \
            file://add_hostap.patch;patch=1 \
            http://handhelds.org/~pb/mb-panel-0.9.2-polling.patch;patch=1 \
            http://handhelds.org/~pb/mb-panel-0.9.2-msgcancel.patch;patch=1 \
+           file://mb-applet-battery-repaint.patch;patch=1 \
           file://system-monitor-crash-fix.patch;patch=1 "