summaryrefslogtreecommitdiff
path: root/packages/matchbox-panel
diff options
context:
space:
mode:
Diffstat (limited to 'packages/matchbox-panel')
-rw-r--r--packages/matchbox-panel/matchbox-panel-0.9.2/mb-applet-battery-repaint.patch43
-rw-r--r--packages/matchbox-panel/matchbox-panel-0.9.2/system-monitor-crash-fix.patch161
-rw-r--r--packages/matchbox-panel/matchbox-panel_0.9.2.bb5
3 files changed, 207 insertions, 2 deletions
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
index 0000000000..7d5c53f165
--- /dev/null
+++ b/packages/matchbox-panel/matchbox-panel-0.9.2/mb-applet-battery-repaint.patch
@@ -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
diff --git a/packages/matchbox-panel/matchbox-panel-0.9.2/system-monitor-crash-fix.patch b/packages/matchbox-panel/matchbox-panel-0.9.2/system-monitor-crash-fix.patch
new file mode 100644
index 0000000000..c9a49fb881
--- /dev/null
+++ b/packages/matchbox-panel/matchbox-panel-0.9.2/system-monitor-crash-fix.patch
@@ -0,0 +1,161 @@
+--- matchbox-panel-0.9.2/applets/mb-applet-system-monitor.c.orig 2006-02-04 19:22:55.000000000 +0200
++++ matchbox-panel-0.9.2/applets/mb-applet-system-monitor.c 2006-02-04 18:18:21.000000000 +0200
+@@ -37,6 +37,16 @@
+ # define _(text) (text)
+ #endif
+
++#ifdef HAVE_LINUX_VER_H
++#include <linux/version.h>
++#else
++#define LINUX_VERSION_CODE 0
++#endif
++
++#ifndef KERNEL_VERSION
++#define KERNEL_VERSION(a,b,c) (((a) << 16) | ((b) << 8) | (c))
++#endif
++
+ #ifdef MB_HAVE_PNG
+ #define IMG_EXT "png"
+ #else
+@@ -112,71 +122,83 @@
+
+ int system_memory(void)
+ {
+- u_int64_t my_mem_used, my_mem_max;
+- u_int64_t my_swap_max;
+-
+- static int mem_delay = 0;
+- FILE *mem;
+- static u_int64_t total, used, mfree, shared, buffers, cached,
+- cache_total, cache_used;
+-
+- /* put this in permanent storage instead of stack */
+- static char not_needed[2048];
+-
+- if (mem_delay-- <= 0) {
+- if ((mem = fopen("/proc/meminfo", "r")) == NULL)
++ u_int64_t total, mfree, buffers, cached, used, shared,
++ cache_total, cache_free, cache_used, uneeded = 0;
++
++ u_int64_t my_mem_used, my_mem_max;
++ u_int64_t my_swap_max;
++
++ static int mem_delay = 0;
++ FILE *mem;
++
++ /* put this in permanent storage instead of stack */
++ static char not_needed[2048];
++
++ if (mem_delay-- <= 0)
++ {
++ if ((mem = fopen("/proc/meminfo", "r")) == NULL)
+ {
+ fprintf(stderr, "mb-applet-system-monitor: failed to open /proc/meminfo. Exiting.\n");
+ exit(1);
+- }
+-
+-
+-
+- fgets(not_needed, 2048, mem);
+-
+- /*
+- total: used: free: shared: buffers: cached:
+- */
+-
+- fscanf(mem, "%*s %Ld %Ld %Ld %Ld %Ld %Ld", &total, &used, &mfree,
+- &shared, &buffers, &cached);
+-
+- fscanf(mem, "%*s %Ld %Ld", &cache_total, &cache_used);
+-
+- fclose(mem);
+- mem_delay = 25;
+-
+- /* calculate it */
+- my_mem_max = total;
+- my_swap_max = cache_total;
+-
+- my_mem_used = cache_used + used - cached - buffers;
+-
+- /* No swap on ipaq
+- if (my_mem_used > my_mem_max) {
+- my_swap_used = my_mem_used - my_mem_max;
+- my_mem_used = my_mem_max;
+- } else {
+- my_swap_used = 0;
+ }
+- */
+-
+- msd.mem_used = my_mem_used;
+- msd.mem_max = my_mem_max;
+- //msd.swap_used = my_swap_used;
+- //msd.swap_max = my_swap_max;
++
++ fgets(not_needed, 2048, mem);
+
+- msd.mem_percent = (100 * msd.mem_used) / msd.mem_max;
+- //msd.swap_percent = (100 * msd.swap_used) / msd.swap_max;
+-
+- /* memory info changed - update things */
+- return 1;
+- }
+- /* nothing new */
+- return 0;
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
++
++ rewind (mem);
++
++ fscanf (mem, "%*s %Ld %*s", &total);
++ fscanf (mem, "%*s %Ld %*s", &mfree);
++ fscanf (mem, "%*s %Ld %*s", &buffers);
++ fscanf (mem, "%*s %Ld %*s", &cached);
++ fscanf (mem, "%*s %Ld %*s", &shared);
++ fscanf (mem, "%*s %Ld %*s", &used);
++ fscanf (mem, "%*s %Ld %*s", &uneeded);
++ fscanf (mem, "%*s %Ld %*s", &uneeded);
++ fscanf (mem, "%*s %Ld %*s", &uneeded);
++ fscanf (mem, "%*s %Ld %*s", &uneeded);
++ fscanf (mem, "%*s %Ld %*s", &uneeded);
++ fscanf (mem, "%*s %Ld %*s", &cache_total);
++ fscanf (mem, "%*s %Ld %*s", &cache_free);
++
++ total = total * 1024;
++ mfree = mfree * 1024;
++ buffers = buffers * 1024;
++ cached = cached * 1024;
++ used = used * 1024;
++ shared = shared * 1024;
++ cache_total = cache_total * 1024;
++ cache_used = cache_total - (cache_free * 1024);
++#else
++ /*
++ total: used: free: shared: buffers: cached:
++ */
++ fscanf(mem, "%*s %Ld %Ld %Ld %Ld %Ld %Ld", &total, &used, &mfree,
++ &shared, &buffers, &cached);
++ fscanf(mem, "%*s %Ld %Ld", &cache_total, &cache_used);
++
++#endif
++
++ fclose(mem);
++
++ mem_delay = 25;
++
++ /* calculate it */
++ my_mem_max = total;
++ my_swap_max = cache_total;
++ my_mem_used = cache_used + used - cached - buffers;
++ msd.mem_used = my_mem_used;
++ msd.mem_max = my_mem_max;
++ msd.mem_percent = (100 * msd.mem_used) / msd.mem_max;
++
++ /* memory info changed - update things */
++ return 1;
++ }
++ /* nothing new */
++ return 0;
+ }
+
+-
+ void
+ paint_callback (MBTrayApp *app, Drawable drw )
+ {
diff --git a/packages/matchbox-panel/matchbox-panel_0.9.2.bb b/packages/matchbox-panel/matchbox-panel_0.9.2.bb
index 0b7df29693..4c037690b6 100644
--- a/packages/matchbox-panel/matchbox-panel_0.9.2.bb
+++ b/packages/matchbox-panel/matchbox-panel_0.9.2.bb
@@ -1,10 +1,11 @@
include matchbox-panel.inc
-PR="r6"
+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://kernel2.6.patch;patch=1"
+ file://mb-applet-battery-repaint.patch;patch=1 \
+ file://system-monitor-crash-fix.patch;patch=1 "