patch-bubblemon_c 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. $OpenBSD: patch-bubblemon_c,v 1.2 2014/10/07 09:10:54 dcoppa Exp $
  2. Unbreak with GTK+ >= 2.18
  3. --- bubblemon.c.orig Wed Oct 1 02:37:32 2003
  4. +++ bubblemon.c Tue Oct 7 11:05:05 2014
  5. @@ -44,7 +44,7 @@
  6. */
  7. #define _GNU_SOURCE
  8. -#define VERSION "1.41"
  9. +#define VERSION "1.46"
  10. /* general includes */
  11. #include <stdio.h>
  12. @@ -58,6 +58,7 @@
  13. #include <gdk/gdk.h>
  14. #include <gdk/gdkx.h>
  15. #include <X11/Xresource.h>
  16. +#include <gtk/gtk.h>
  17. #include "include/master.xpm"
  18. #include "include/bubblemon.h"
  19. @@ -275,6 +276,7 @@ static void print_usage(void)
  20. int main(int argc, char **argv)
  21. {
  22. + setenv("GDK_NATIVE_WINDOWS", "1", 0);
  23. char execute[256];
  24. int proximity = 0;
  25. int ch;
  26. @@ -575,7 +577,7 @@ static void make_new_bubblemon_dockapp(void)
  27. attri.colormap = gdk_colormap_get_system();
  28. attri.wmclass_name = "bubblemon";
  29. attri.wmclass_class = "bubblemon";
  30. - attri.window_type = GDK_WINDOW_TOPLEVEL;
  31. + attri.window_type = GDK_WINDOW_CHILD;
  32. bm.iconwin = gdk_window_new(bm.win, &attri,
  33. GDK_WA_TITLE | GDK_WA_WMCLASS);
  34. @@ -593,7 +595,6 @@ static void make_new_bubblemon_dockapp(void)
  35. wmhints.window_group = win;
  36. wmhints.flags =
  37. StateHint | IconWindowHint | IconPositionHint | WindowGroupHint;
  38. - XSetWMHints(GDK_WINDOW_XDISPLAY(bm.win), win, &wmhints);
  39. bm.gc = gdk_gc_new(bm.win);
  40. @@ -606,10 +607,10 @@ static void make_new_bubblemon_dockapp(void)
  41. gdk_window_set_back_pixmap(bm.iconwin, bm.pixmap, False);
  42. gdk_window_show(bm.win);
  43. -#ifdef KDE_DOCKAPP
  44. - /* makes the dockapp visible inside KDE wm */
  45. +
  46. + XSetWMHints(GDK_WINDOW_XDISPLAY(bm.win), win, &wmhints);
  47. +
  48. gdk_window_show(bm.iconwin);
  49. -#endif
  50. /* We begin with zero bubbles */
  51. bm.n_bubbles = 0;
  52. @@ -664,7 +665,7 @@ static void bubblemon_update(int proximity)
  53. /* y coordinates are counted from here multiplied by 256 */
  54. /* to get actual screen coordinate, divide by 256 */
  55. buf = bm.bubblebuf;
  56. - col = bm.colors;
  57. + col = (unsigned int *)bm.colors;
  58. waterlevel_max = 0;
  59. waterlevel_min = MAKEY(56);
  60. @@ -957,7 +958,7 @@ static void bubblemon_update(int proximity)
  61. static void draw_digit(int srcx, int srcy, int destx, int desty)
  62. {
  63. int i, j;
  64. - char *from, *to;
  65. + unsigned char *from, *to;
  66. for (j = 0; j < 8; j++) {
  67. from = mem_screen + 56 * 3 * (srcy + j) + srcx * 3;
  68. @@ -1005,7 +1006,7 @@ static void draw_history(int num, int size, unsigned i
  69. {
  70. int pixels_per_byte;
  71. int j, k;
  72. - int *p;
  73. + unsigned int *p;
  74. int d;
  75. pixels_per_byte = 100;
  76. @@ -1024,9 +1025,9 @@ static void draw_history(int num, int size, unsigned i
  77. for (j = 0; j < size; j++) {
  78. if (j < d - 2)
  79. - draw_pixel(k, size - j - 1, buf, "\x00\x7d\x71");
  80. + draw_pixel(k, size - j - 1, buf, (unsigned char *) "\x00\x7d\x71");
  81. else if (j < d)
  82. - draw_pixel(k, size - j - 1, buf, "\x20\xb6\xae");
  83. + draw_pixel(k, size - j - 1, buf, (unsigned char *) "\x20\xb6\xae");
  84. }
  85. p++;
  86. }
  87. @@ -1034,7 +1035,7 @@ static void draw_history(int num, int size, unsigned i
  88. for (j = pixels_per_byte - 100; j > 0; j -= 100) {
  89. for (k = 0; k < num; k++) {
  90. d = ((float) size / pixels_per_byte) * j;
  91. - draw_pixel(k, size - d - 1, buf, "\x71\xe3\x71");
  92. + draw_pixel(k, size - d - 1, buf, (unsigned char *) "\x71\xe3\x71");
  93. }
  94. }
  95. }