[Zinf-devel] [PATCH] Fix compilation and bitmap depth on debian sid
Brought to you by:
kgk,
mayhemchaos
From: Fabio C. <fa...@ga...> - 2008-01-14 08:54:42
|
Hi all, this list seems to be not so active, anyway I've tried zinf after a long time, and I had several problems building and running it. This patch fixes the build issues reported here: http://sourceforge.net/mailarchive/forum.php?thread_name=20070811210027.1d4e2c92%40darkstar.localhost&forum_name=zinf-support and seems to be a correct fix to this tracker issue: http://sourceforge.net/tracker/index.php?func=detail&aid=1033026&group_id=51494&atid=463479 Still getting segfaults on theme changes and on exit. Patch on top of 2.2.5, please consider applying. I'm posting the patch here and not on the tracker to ask also for the project status... is anyone still working on zinf? -- diff -Naurp zinf-2.2.5.orig/base/include/player.h zinf-2.2.5/base/include/player.h --- zinf-2.2.5.orig/base/include/player.h 2004-02-02 18:39:35.000000000 +0100 +++ zinf-2.2.5/base/include/player.h 2008-01-11 20:01:32.000000000 +0100 @@ -155,13 +155,13 @@ class Player : public EventQueue #define _EQUALIZER_ENABLE_ #ifdef _EQUALIZER_ENABLE_ - void Player::SetEQData(Event *pEvent); + void SetEQData(Event *pEvent); #endif // _EQUALIZER_ENABLE_ #undef _EQUALIZER_ENABLE_ #define _VISUAL_ENABLE_ #ifdef _VISUAL_ENABLE_ - void Player::SendVisBuf(Event *pEvent); + void SendVisBuf(Event *pEvent); #endif // _VISUAL_ENABLE_ #undef _VISUAL_ENABLE_ diff -Naurp zinf-2.2.5.orig/base/include/queue.h zinf-2.2.5/base/include/queue.h --- zinf-2.2.5.orig/base/include/queue.h 2003-09-16 19:34:53.000000000 +0200 +++ zinf-2.2.5/base/include/queue.h 2008-01-11 20:00:47.000000000 +0100 @@ -24,6 +24,7 @@ ________________________________________ #ifndef INCLUDED_QUEUE_H_ #define INCLUDED_QUEUE_H_ +#include <assert.h> #include "config.h" #include "mutex.h" diff -Naurp zinf-2.2.5.orig/ui/zinf/unix/include/GTKBitmap.h zinf-2.2.5/ui/zinf/unix/include/GTKBitmap.h --- zinf-2.2.5.orig/ui/zinf/unix/include/GTKBitmap.h 2003-09-16 19:36:23.000000000 +0200 +++ zinf-2.2.5/ui/zinf/unix/include/GTKBitmap.h 2008-01-14 09:19:00.000000000 +0100 @@ -72,6 +72,8 @@ class GTKBitmap : public Bitmap Error ReadleShort(FILE *file, gushort *ret); Error ReadleLong(FILE *file, gulong *ret); + static GdkWindow *m_rootWindow; + GdkPixmap *m_Bitmap; GdkPixmap *m_MaskBitmap; diff -Naurp zinf-2.2.5.orig/ui/zinf/unix/src/GTKBitmap.cpp zinf-2.2.5/ui/zinf/unix/src/GTKBitmap.cpp --- zinf-2.2.5.orig/ui/zinf/unix/src/GTKBitmap.cpp 2003-09-16 19:36:23.000000000 +0200 +++ zinf-2.2.5/ui/zinf/unix/src/GTKBitmap.cpp 2008-01-14 09:19:29.000000000 +0100 @@ -51,6 +51,8 @@ RGBQUAD; #define BI_RLE4 2 #define BI_BITFIELDS 3 +static GDKWindow *GTKBitmap::m_rootWindow; + GTKBitmap::GTKBitmap(string &oName) :Bitmap(oName) { @@ -59,7 +61,9 @@ GTKBitmap::GTKBitmap(string &oName) m_Bitmap = NULL; m_MaskBitmap = NULL; gdk_threads_enter(); - m_GC = gdk_gc_new(gdk_window_foreign_new(GDK_ROOT_WINDOW())); + if (m_rootWindow == NULL) + m_rootWindow = gdk_window_foreign_new(GDK_ROOT_WINDOW()); + m_GC = gdk_gc_new(m_rootWindow); gdk_threads_leave(); m_width = 0; m_height = 0; @@ -72,8 +76,10 @@ GTKBitmap::GTKBitmap(int iWidth, int iHe m_oBitmapName = oName; shape_set = false; gdk_threads_enter(); - m_Bitmap = gdk_pixmap_new(NULL, iWidth, iHeight, - gdk_visual_get_best_depth()); + if (m_rootWindow == NULL) + m_rootWindow = gdk_window_foreign_new(GDK_ROOT_WINDOW()); + m_Bitmap = gdk_pixmap_new(m_rootWindow, iWidth, iHeight, + gdk_drawable_get_depth(m_rootWindow)); m_MaskBitmap = gdk_pixmap_new(NULL, iWidth, iHeight, 1); m_GC = gdk_gc_new(gdk_window_foreign_new(GDK_ROOT_WINDOW())); gdk_threads_leave(); @@ -150,7 +156,7 @@ Error GTKBitmap::LoadBitmapFromDisk(stri newbuf = gdk_pixbuf_add_alpha(pixbuf, m_bHasTransColor, m_oTransColor.red, m_oTransColor.green, m_oTransColor.blue); - gdk_pixbuf_render_pixmap_and_mask(newbuf, &m_Bitmap, &m_MaskBitmap, + gdk_pixbuf_render_pixmap_and_mask(newbuf, &m_Bitmap, &m_MaskBitmap, 255); m_width = gdk_pixbuf_get_width(newbuf); m_height = gdk_pixbuf_get_height(newbuf); @@ -546,7 +552,8 @@ Error GTKBitmap::LoadBitmapFromDisk(stri gdk_gc_destroy(gc); } - m_Bitmap = gdk_pixmap_new(NULL, w, h, gdk_visual_get_best_depth()); + m_Bitmap = gdk_pixmap_new(m_rootWindow, w, h, + gdk_drawable_get_depth(root)); gdk_draw_rgb_image(m_Bitmap, m_GC, 0, 0, w, h, GDK_RGB_DITHER_MAX, data, w * 3); |