pkgsrc/sysutils/bubblemon/patches/patch-gtk2
ahoka b0cf8f763e Import bubblemon-1.46 as sysutils/bubblemon.
A system monitoring dockapp, visually based on the GNOME "BubbleMon"
applet. Features a duck and bubbles, water level depending on memory use.

Contributed by Gabor Gergely in private mail.
2009-07-20 14:06:02 +00:00

87 lines
2.6 KiB
Text

$NetBSD: patch-gtk2,v 1.1.1.1 2009/07/20 14:06:02 ahoka Exp $
--- bubblemon.c.orig 2003-10-01 02:37:32.000000000 +0200
+++ bubblemon.c
@@ -44,7 +44,7 @@
*/
#define _GNU_SOURCE
-#define VERSION "1.41"
+#define VERSION "1.42"
/* general includes */
#include <stdio.h>
@@ -575,7 +575,7 @@ static void make_new_bubblemon_dockapp(v
attri.colormap = gdk_colormap_get_system();
attri.wmclass_name = "bubblemon";
attri.wmclass_class = "bubblemon";
- attri.window_type = GDK_WINDOW_TOPLEVEL;
+ attri.window_type = GDK_WINDOW_CHILD;
bm.iconwin = gdk_window_new(bm.win, &attri,
GDK_WA_TITLE | GDK_WA_WMCLASS);
@@ -593,7 +593,6 @@ static void make_new_bubblemon_dockapp(v
wmhints.window_group = win;
wmhints.flags =
StateHint | IconWindowHint | IconPositionHint | WindowGroupHint;
- XSetWMHints(GDK_WINDOW_XDISPLAY(bm.win), win, &wmhints);
bm.gc = gdk_gc_new(bm.win);
@@ -611,6 +610,8 @@ static void make_new_bubblemon_dockapp(v
gdk_window_show(bm.iconwin);
#endif
+ XSetWMHints(GDK_WINDOW_XDISPLAY(bm.win), win, &wmhints);
+
/* We begin with zero bubbles */
bm.n_bubbles = 0;
@@ -664,7 +665,7 @@ static void bubblemon_update(int proximi
/* y coordinates are counted from here multiplied by 256 */
/* to get actual screen coordinate, divide by 256 */
buf = bm.bubblebuf;
- col = bm.colors;
+ col = (unsigned int *)bm.colors;
waterlevel_max = 0;
waterlevel_min = MAKEY(56);
@@ -957,7 +958,7 @@ static void bubblemon_update(int proximi
static void draw_digit(int srcx, int srcy, int destx, int desty)
{
int i, j;
- char *from, *to;
+ unsigned char *from, *to;
for (j = 0; j < 8; j++) {
from = mem_screen + 56 * 3 * (srcy + j) + srcx * 3;
@@ -1005,7 +1006,7 @@ static void draw_history(int num, int si
{
int pixels_per_byte;
int j, k;
- int *p;
+ unsigned int *p;
int d;
pixels_per_byte = 100;
@@ -1024,9 +1025,9 @@ static void draw_history(int num, int si
for (j = 0; j < size; j++) {
if (j < d - 2)
- draw_pixel(k, size - j - 1, buf, "\x00\x7d\x71");
+ draw_pixel(k, size - j - 1, buf, (unsigned char *) "\x00\x7d\x71");
else if (j < d)
- draw_pixel(k, size - j - 1, buf, "\x20\xb6\xae");
+ draw_pixel(k, size - j - 1, buf, (unsigned char *) "\x20\xb6\xae");
}
p++;
}
@@ -1034,7 +1035,7 @@ static void draw_history(int num, int si
for (j = pixels_per_byte - 100; j > 0; j -= 100) {
for (k = 0; k < num; k++) {
d = ((float) size / pixels_per_byte) * j;
- draw_pixel(k, size - d - 1, buf, "\x71\xe3\x71");
+ draw_pixel(k, size - d - 1, buf, (unsigned char *) "\x71\xe3\x71");
}
}
}