Re: [AD] AllegroGL for 4.2.0 |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
> Another thing that's still broken is that the window icon under X11
> changes to some default icon if you use AllegroGL.. I think Evert had a
> patch for it though.
I think this is the one, but I could be wrong. Took me a while to find it
again on my harddrive.
If it isn't the correct patch, then I've posted that sometime and it should
be in the archives somewhere.
Evert
Index: src/x.c
===================================================================
RCS file: /cvsroot/allegrogl/alleggl/src/x.c,v
retrieving revision 1.68
diff -u -r1.68 x.c
--- src/x.c 19 Mar 2005 19:28:25 -0000 1.68
+++ src/x.c 31 May 2005 21:54:04 -0000
@@ -10,6 +10,10 @@
#include <allegro/platform/aintunix.h>
+#ifdef ALLEGRO_XWINDOWS_WITH_XPM
+#include <X11/xpm.h>
+#endif
+
#include "alleggl.h"
#include "allglint.h"
#include "glvtable.h"
@@ -23,6 +27,11 @@
#endif
+#ifdef ALLEGRO_XWINDOWS_WITH_XPM
+extern void *allegro_icon;
+#endif
+
+
static BITMAP *allegro_gl_x_windowed_init(int w, int h, int vw, int vh,
int color_depth);
static void allegro_gl_x_exit(BITMAP *bmp);
@@ -545,6 +554,9 @@
#ifdef ALLEGROGL_HAVE_XF86VIDMODE
int bestmode=0;
#endif
+#ifdef ALLEGRO_XWINDOWS_WITH_XPM
+ XpmAttributes attributes;
+#endif
if (_xwin.display == 0) {
return -1;
@@ -780,6 +792,15 @@
wm_hints.flags = InputHint | StateHint;
wm_hints.input = True;
wm_hints.initial_state = NormalState;
+
+#ifdef ALLEGRO_XWINDOWS_WITH_XPM
+ if (allegro_icon) {
+ wm_hints.flags |= IconPixmapHint | IconMaskHint | WindowGroupHint;
+ attributes.valuemask = XpmReturnAllocPixels | XpmReturnExtensions;
+ XpmCreatePixmapFromData(_xwin.display,_xwin.window,allegro_icon,&wm_hints.icon_pixmap,&wm_hints.icon_mask, &attributes);
+ }
+#endif
+
XSetWMHints(_xwin.display, _xwin.window, &wm_hints);
}