]> pilppa.org Git - familiar-h63xx-build.git/blob - org.handhelds.familiar/packages/matchbox-panel/matchbox-panel-0.9.2/mb-applet-battery-repaint.patch
OE tree imported from monotone branch org.openembedded.oz354fam083 at revision 8b12e3...
[familiar-h63xx-build.git] / org.handhelds.familiar / packages / matchbox-panel / matchbox-panel-0.9.2 / mb-applet-battery-repaint.patch
1 --- matchbox-panel-0.9.2/applets/mb-applet-battery.c.orig       2005-04-06 22:20:45.000000000 +0200
2 +++ matchbox-panel-0.9.2/applets/mb-applet-battery.c            2006-02-01 01:21:17.000000000 +0100
3 @@ -200,23 +200,12 @@
4  void
5  paint_callback (MBTrayApp *app, Drawable drw )
6  {
7 -
8 -
9    int      power_pixels = 0;
10    unsigned char r = 0, g = 0, b = 0;
11    int      x, y;
12    int      bar_width, bar_height, bar_x, bar_y;
13  
14    MBPixbufImage *img_backing = NULL;
15 -  
16 -
17 -
18 -
19 -  while (!read_apm(apm_vals))
20 -    usleep(50000L);
21 -
22 -  if (last_percentage == apm_vals[PERCENTAGE] && last_ac == apm_vals[AC_POWER])
23 -    return;
24  
25    img_backing = mb_tray_app_get_background (app, pb);
26  
27 @@ -409,10 +398,12 @@
28  
29  }
30  
31 -void
32 -timeout_callback ( MBTrayApp *app )
33 -{
34 -  mb_tray_app_repaint (app);
35 +void timeout_callback (MBTrayApp *app) {
36 +       while (!read_apm(apm_vals))
37 +               usleep(50000L);
38 +
39 +       if (last_percentage != apm_vals[PERCENTAGE] || last_ac != apm_vals[AC_POWER])
40 +               mb_tray_app_repaint (app);
41  }
42  
43  void