From ef498eaf86b055592b44b13c0748317751b2bdf4 Mon Sep 17 00:00:00 2001 From: NicJA Date: Mon, 15 Dec 2014 18:20:24 +0000 Subject: [PATCH] provide more consistent and verbose debug (was used to track down the issue with x11 windows not becoming visible) as requested. minor re-factor of x11 task code. git-svn-id: https://svn.aros.org/svn/aros/trunk/AROS@49850 fb15a70f-31f2-0310-bbcc-cdcc74a49acc --- arch/all-hosted/hidd/x11/bitmap_common.c | 118 +++++++++------ arch/all-hosted/hidd/x11/fullscreen.c | 5 +- arch/all-hosted/hidd/x11/offbitmap.c | 20 +-- arch/all-hosted/hidd/x11/onbitmap.c | 52 ++++--- arch/all-hosted/hidd/x11/support.c | 5 +- arch/all-hosted/hidd/x11/x11.c | 244 +++++++++++++++++-------------- arch/all-hosted/hidd/x11/x11_debug.h | 7 + arch/all-hosted/hidd/x11/x11_hostlib.c | 32 ++-- arch/all-hosted/hidd/x11/x11_init.c | 34 +++-- arch/all-hosted/hidd/x11/x11gfx.c | 100 ++++++++----- 10 files changed, 366 insertions(+), 251 deletions(-) create mode 100644 arch/all-hosted/hidd/x11/x11_debug.h diff --git a/arch/all-hosted/hidd/x11/bitmap_common.c b/arch/all-hosted/hidd/x11/bitmap_common.c index 2b3539dce3..4866245c22 100644 --- a/arch/all-hosted/hidd/x11/bitmap_common.c +++ b/arch/all-hosted/hidd/x11/bitmap_common.c @@ -1,14 +1,15 @@ /* - Copyright © 1995-2013, The AROS Development Team. All rights reserved. + Copyright © 1995-2014, The AROS Development Team. All rights reserved. $Id$ */ +#include "x11_debug.h" + #include #include #include #include -#include #include #include #include @@ -57,7 +58,7 @@ OOP_Object *X11BM__Root__New(OOP_Class *cl, OOP_Object *o, struct pRoot_New *msg) { - EnterFunc(bug("X11Gfx.BitMap::New()\n")); + D(bug("[X11Bm] %s()\n", __PRETTY_FUNCTION__)); o = (OOP_Object *) OOP_DoSuperMethod(cl, o, (OOP_Msg) msg); if (o) @@ -73,7 +74,10 @@ OOP_Object *X11BM__Root__New(OOP_Class *cl, OOP_Object *o, struct pRoot_New *msg data->colmap = (Colormap) GetTagData(aHidd_X11BitMap_ColorMap, 0, msg->attrList); framebuffer = GetTagData(aHidd_BitMap_FrameBuffer, FALSE, msg->attrList); - D(bug("[X11BM] Display 0x%p, screen %d, cursor 0x%p, colormap 0x%p\n", data->display, data->screen, data->cursor, data->colmap)); + D( + bug("[X11Bm] %s: display @ 0x%p, screen #%d\n", __PRETTY_FUNCTION__, data->display, data->screen); + bug("[X11Bm] %s: cursor @ 0x%p, colormap @ 0x%p\n", __PRETTY_FUNCTION__, data->cursor, data->colmap); + ) if (framebuffer) { @@ -109,19 +113,17 @@ OOP_Object *X11BM__Root__New(OOP_Class *cl, OOP_Object *o, struct pRoot_New *msg #endif } - if (ok) - { - ReturnPtr("X11Gfx.OnBitMap::New()", OOP_Object *, o); - } - else + if (!ok) { OOP_MethodID disp_mid = OOP_GetMethodID(IID_Root, moRoot_Dispose); OOP_CoerceMethod(cl, o, (OOP_Msg) &disp_mid); + o = NULL; } } /* if (object allocated by superclass) */ - ReturnPtr("X11Gfx.OnBitMap::New()", OOP_Object *, NULL); + D(bug("[X11Bm] %s: returning object @ 0x%p\n", __PRETTY_FUNCTION__, o)); + return o; } /****************************************************************************************/ @@ -130,7 +132,7 @@ VOID X11BM__Root__Dispose(OOP_Class *cl, OOP_Object *o, OOP_Msg msg) { struct bitmap_data *data = OOP_INST_DATA(cl, o); - EnterFunc(bug("X11Gfx.BitMap::Dispose()\n")); + D(bug("[X11Bm] %s()\n", __PRETTY_FUNCTION__)); if (data->gc) { @@ -145,7 +147,6 @@ VOID X11BM__Root__Dispose(OOP_Class *cl, OOP_Object *o, OOP_Msg msg) X11BM_DisposePM(data); OOP_DoSuperMethod(cl, o, msg); - ReturnVoid("X11Gfx.BitMap::Dispose"); } /****************************************************************************************/ @@ -154,6 +155,8 @@ VOID X11BM__Hidd_BitMap__Clear(OOP_Class *cl, OOP_Object *o, struct pHidd_BitMap { struct bitmap_data *data = OOP_INST_DATA(cl, o); + D(bug("[X11Bm] %s()\n", __PRETTY_FUNCTION__)); + HostLib_Lock(); if (data->flags & BMDF_FRAMEBUFFER) @@ -171,6 +174,8 @@ static void SwapImageEndianess(XImage *image) LONG x, y, height, width, bpp; UBYTE *imdata = (UBYTE *) image->data; + D(bug("[X11Bm] %s()\n", __PRETTY_FUNCTION__)); + width = image->width; height = image->height; bpp = (image->bits_per_pixel + 7) / 8; @@ -234,6 +239,8 @@ BOOL MNAME(Hidd_BitMap__SetColors)(OOP_Class *cl, OOP_Object *o, struct pHidd_Bi HIDDT_PixelFormat *pf; ULONG xc_i, col_i; + D(bug("[X11Bm] %s()\n", __PRETTY_FUNCTION__)); + if (!OOP_DoSuperMethod(cl, o, &msg->mID)) return FALSE; @@ -279,6 +286,8 @@ VOID MNAME(Hidd_BitMap__PutPixel)(OOP_Class *cl, OOP_Object *o, struct pHidd_Bit { struct bitmap_data *data = OOP_INST_DATA(cl, o); + D(bug("[X11Bm] %s()\n", __PRETTY_FUNCTION__)); + LOCK_X11 XCALL(XSetForeground, data->display, data->gc, msg->pixel); @@ -296,6 +305,8 @@ HIDDT_Pixel MNAME(Hidd_BitMap__GetPixel)(OOP_Class *cl, OOP_Object *o, struct pH HIDDT_Pixel pixel = -1; XImage *image; + D(bug("[X11Bm] %s()\n", __PRETTY_FUNCTION__)); + LOCK_X11 XCALL(XSync, data->display, False); @@ -321,6 +332,8 @@ ULONG MNAME(Hidd_BitMap__DrawPixel)(OOP_Class *cl, OOP_Object *o, struct pHidd_B struct bitmap_data *data = OOP_INST_DATA(cl, o); XGCValues gcval; + D(bug("[X11Bm] %s()\n", __PRETTY_FUNCTION__)); + gcval.function = GC_DRMD(msg->gc); gcval.foreground = GC_FG(msg->gc); gcval.background = GC_BG(msg->gc); @@ -340,9 +353,8 @@ VOID MNAME(Hidd_BitMap__FillRect)(OOP_Class *cl, OOP_Object *o, struct pHidd_Bit struct bitmap_data *data = OOP_INST_DATA(cl, o); XGCValues gcval; - EnterFunc(bug("X11Gfx.BitMap::FillRect(%d,%d,%d,%d)\n", msg->minX, msg->minY, msg->maxX, msg->maxY)); - - D(bug("Drawmode: %d\n", GC_DRMD(msg->gc))); + D(bug("[X11Bm] %s(%d,%d,%d,%d)\n", __PRETTY_FUNCTION__, msg->minX, msg->minY, msg->maxX, msg->maxY)); + D(bug("[X11Bm] %s: Drawmode = %d\n", __PRETTY_FUNCTION__, GC_DRMD(msg->gc))); gcval.function = GC_DRMD(msg->gc); gcval.foreground = GC_FG(msg->gc); @@ -354,8 +366,6 @@ VOID MNAME(Hidd_BitMap__FillRect)(OOP_Class *cl, OOP_Object *o, struct pHidd_Bit XCALL(XFillRectangle, data->display, DRAWABLE(data), data->gc, msg->minX, msg->minY, msg->maxX - msg->minX + 1, msg->maxY - msg->minY + 1); UNLOCK_X11 - - ReturnVoid("X11Gfx.BitMap::FillRect"); } /****************************************************************************************/ @@ -363,6 +373,8 @@ VOID MNAME(Hidd_BitMap__FillRect)(OOP_Class *cl, OOP_Object *o, struct pHidd_Bit static ULONG *ximage_to_buf(OOP_Class *cl, OOP_Object *bm, HIDDT_Pixel *buf, XImage *image, ULONG width, ULONG height, ULONG depth, struct pHidd_BitMap_GetImage *msg) { + D(bug("[X11Bm] %s()\n", __PRETTY_FUNCTION__)); + switch (msg->pixFmt) { case vHidd_StdPixFmt_Native: @@ -470,20 +482,20 @@ static ULONG *ximage_to_buf(OOP_Class *cl, OOP_Object *bm, HIDDT_Pixel *buf, XIm OOP_Object *srcpf, *dstpf, *gfxhidd; APTR srcPixels = image->data, dstBuf = buf; - //kprintf("DEFAULT PIXEL CONVERSION\n"); + //bug("DEFAULT PIXEL CONVERSION\n"); OOP_GetAttr(bm, aHidd_BitMap_GfxHidd, (IPTR *) &gfxhidd); dstpf = HIDD_Gfx_GetPixFmt(gfxhidd, msg->pixFmt); OOP_GetAttr(bm, aHidd_BitMap_PixFmt, (IPTR *) &srcpf); - //kprintf("CALLING ConvertPixels()\n"); + //bug("CALLING ConvertPixels()\n"); HIDD_BM_ConvertPixels(bm, &srcPixels, (HIDDT_PixelFormat *) srcpf, image->bytes_per_line, &dstBuf, (HIDDT_PixelFormat *) dstpf, msg->modulo, width, height, NULL /* We have no CLUT */ ); - //kprintf("CONVERTPIXELS DONE\n"); + //bug("CONVERTPIXELS DONE\n"); buf = (HIDDT_Pixel *) ((UBYTE *) buf + msg->modulo * height); break; @@ -506,6 +518,8 @@ static inline UBYTE pix_to_lut(HIDDT_Pixel pixel, HIDDT_PixelLUT *plut, HIDDT_Pi ULONG i, best_match = 0; ULONG diff, lowest_diff = 0xFFFFFFFF; + D(bug("[X11Bm] %s()\n", __PRETTY_FUNCTION__)); + red = RED_COMP(pixel, pf); green = GREEN_COMP(pixel, pf); blue = BLUE_COMP(pixel, pf); @@ -546,6 +560,8 @@ static UBYTE *ximage_to_buf_lut(OOP_Class *cl, OOP_Object *bm, UBYTE *buf, XImag HIDDT_PixelFormat *pf = BM_PIXFMT(bm); UBYTE *pixarray = msg->pixels; + D(bug("[X11Bm] %s()\n", __PRETTY_FUNCTION__)); + if (image->bits_per_pixel == 16) { UWORD *imdata = (UWORD *) image->data; @@ -611,6 +627,8 @@ static void getimage_xshm(OOP_Class *cl, OOP_Object *o, LONG x, LONG y, OOP_Object *pf; Pixmap temp_pixmap = 0; + D(bug("[X11Bm] %s()\n", __PRETTY_FUNCTION__)); + ASSERT(width > 0 && height > 0); data = OOP_INST_DATA(cl, o); @@ -631,7 +649,7 @@ static void getimage_xshm(OOP_Class *cl, OOP_Object *o, LONG x, LONG y, UNLOCK_X11 if (!image) - ReturnVoid("X11Gfx.BitMap::PutImage(XShmCreateImage failed)"); + return; ASSERT(image->bytes_per_line > 0); @@ -640,8 +658,8 @@ static void getimage_xshm(OOP_Class *cl, OOP_Object *o, LONG x, LONG y, if (0 == maxlines) { - kprintf("ALERT !!! NOT ENOUGH MEMORY TO READ A COMPLETE SCANLINE\n"); - kprintf("THROUGH XSHM IN X11GF X HIDD !!!\n"); + bug("ALERT !!! NOT ENOUGH MEMORY TO READ A COMPLETE SCANLINE\n"); + bug("THROUGH XSHM IN X11GF X HIDD !!!\n"); Alert(AT_DeadEnd); } @@ -734,6 +752,8 @@ static void getimage_xlib(OOP_Class *cl, OOP_Object *o, LONG x, LONG y, ULONG wi OOP_Object *pf; IPTR depth; + D(bug("[X11Bm] %s()\n", __PRETTY_FUNCTION__)); + data = OOP_INST_DATA(cl, o); OOP_GetAttr(o, aHidd_BitMap_PixFmt, (IPTR *) &pf); @@ -771,6 +791,8 @@ static void getimage_xlib(OOP_Class *cl, OOP_Object *o, LONG x, LONG y, ULONG wi VOID MNAME(Hidd_BitMap__GetImage)(OOP_Class *cl, OOP_Object *o, struct pHidd_BitMap_GetImage *msg) { + D(bug("[X11Bm] %s()\n", __PRETTY_FUNCTION__)); + ASSERT(msg->width > 0 && msg->height > 0); #if USE_XSHM @@ -790,6 +812,8 @@ VOID MNAME(Hidd_BitMap__GetImage)(OOP_Class *cl, OOP_Object *o, struct pHidd_Bit VOID MNAME(Hidd_BitMap__GetImageLUT)(OOP_Class *cl, OOP_Object *o, struct pHidd_BitMap_GetImageLUT *msg) { + D(bug("[X11Bm] %s()\n", __PRETTY_FUNCTION__)); + ASSERT(msg->width != 0 && msg->height != 0); #if USE_XSHM if (XSD(cl)->use_xshm) @@ -815,6 +839,8 @@ VOID MNAME(Hidd_BitMap__GetImageLUT)(OOP_Class *cl, OOP_Object *o, struct pHidd_ static ULONG *buf_to_ximage(OOP_Class *cl, OOP_Object *bm, HIDDT_Pixel *buf, XImage *image, ULONG width, ULONG height, ULONG depth, struct pHidd_BitMap_PutImage *msg) { + D(bug("[X11Bm] %s()\n", __PRETTY_FUNCTION__)); + switch (msg->pixFmt) { case vHidd_StdPixFmt_Native: @@ -955,19 +981,19 @@ static ULONG *buf_to_ximage(OOP_Class *cl, OOP_Object *bm, HIDDT_Pixel *buf, XIm OOP_Object *srcpf, *dstpf, *gfxhidd; APTR srcPixels = buf, dstBuf = image->data; - //kprintf("DEFAULT PIXEL CONVERSION\n"); + //bug("DEFAULT PIXEL CONVERSION\n"); OOP_GetAttr(bm, aHidd_BitMap_GfxHidd, (IPTR *) &gfxhidd); srcpf = HIDD_Gfx_GetPixFmt(gfxhidd, msg->pixFmt); OOP_GetAttr(bm, aHidd_BitMap_PixFmt, (IPTR *) &dstpf); - //kprintf("CALLING ConvertPixels()\n"); + //bug("CALLING ConvertPixels()\n"); HIDD_BM_ConvertPixels(bm, &srcPixels, (HIDDT_PixelFormat *) srcpf, msg->modulo, &dstBuf, (HIDDT_PixelFormat *) dstpf, image->bytes_per_line, width, height, NULL); /* We have no CLUT */ - //kprintf("CONVERTPIXELS DONE\n"); + //bug("CONVERTPIXELS DONE\n"); buf = (HIDDT_Pixel *) ((UBYTE *) buf + msg->modulo * height); break; @@ -985,6 +1011,8 @@ static UBYTE *buf_to_ximage_lut(OOP_Class *cl, OOP_Object *bm, UBYTE *pixarray, { HIDDT_Pixel *lut = msg->pixlut->pixels; + D(bug("[X11Bm] %s()\n", __PRETTY_FUNCTION__)); + switch (image->bits_per_pixel) { case 8: @@ -1090,6 +1118,8 @@ static void putimage_xshm(OOP_Class *cl, OOP_Object *o, OOP_Object *gc, LONG maxlines; OOP_Object *pf; + D(bug("[X11Bm] %s()\n", __PRETTY_FUNCTION__)); + data = OOP_INST_DATA(cl, o); OOP_GetAttr(o, aHidd_BitMap_PixFmt, (IPTR *)&pf); @@ -1108,15 +1138,15 @@ static void putimage_xshm(OOP_Class *cl, OOP_Object *o, OOP_Object *gc, UNLOCK_X11 if (!image) - ReturnVoid("X11Gfx.BitMap::PutImage(XShmCreateImage failed)"); + return; /* Calculate how many scanline can be stored in the buffer */ maxlines = XSHM_MEMSIZE / image->bytes_per_line; if (0 == maxlines) { - kprintf("ALERT !!! NOT ENOUGH MEMORY TO WRITE A COMPLETE SCANLINE\n"); - kprintf("THROUGH XSHM IN X11GF X HIDD !!!\n"); + bug("ALERT !!! NOT ENOUGH MEMORY TO WRITE A COMPLETE SCANLINE\n"); + bug("THROUGH XSHM IN X11GF X HIDD !!!\n"); Alert(AT_DeadEnd); } @@ -1181,6 +1211,8 @@ static void putimage_xlib(OOP_Class *cl, OOP_Object *o, OOP_Object *gc, LONG x, IPTR depth; OOP_Object *pf; + D(bug("[X11Bm] %s()\n", __PRETTY_FUNCTION__)); + data = OOP_INST_DATA(cl, o); OOP_GetAttr(o, aHidd_BitMap_PixFmt, (IPTR *) &pf); @@ -1200,7 +1232,7 @@ static void putimage_xlib(OOP_Class *cl, OOP_Object *o, OOP_Object *gc, LONG x, UNLOCK_X11 if (!image) - ReturnVoid("X11Gfx.BitMap::PutImage(XCreateImage failed)"); + return; #if DO_ENDIAN_FIX if (NEEDS_ENDIAN_FIX(image)) @@ -1222,7 +1254,7 @@ static void putimage_xlib(OOP_Class *cl, OOP_Object *o, OOP_Object *gc, LONG x, XCALL(XFree, image); UNLOCK_X11 - ReturnVoid("X11Gfx.BitMap::PutImage(malloc(image data) failed)"); + return; } toimage_func(cl, o, pixarray, image, width, height, depth, toimage_data); @@ -1244,8 +1276,7 @@ static void putimage_xlib(OOP_Class *cl, OOP_Object *o, OOP_Object *gc, LONG x, VOID MNAME(Hidd_BitMap__PutImage)(OOP_Class *cl, OOP_Object *o, struct pHidd_BitMap_PutImage *msg) { - EnterFunc( - bug("X11Gfx.BitMap::PutImage(pa=%p, x=%d, y=%d, w=%d, h=%d)\n", msg->pixels, msg->x, msg->y, msg->width, + D(bug("[X11Bm] %s(pa=%p, x=%d, y=%d, w=%d, h=%d)\n", __PRETTY_FUNCTION__, msg->pixels, msg->x, msg->y, msg->width, msg->height)); #if USE_XSHM @@ -1260,16 +1291,13 @@ VOID MNAME(Hidd_BitMap__PutImage)(OOP_Class *cl, OOP_Object *o, struct pHidd_Bit { putimage_xlib(cl, o, msg->gc, msg->x, msg->y, msg->width, msg->height, msg->pixels, (APTR(*)()) buf_to_ximage, msg); } - - ReturnVoid("X11Gfx.BitMap::PutImage"); } /****************************************************************************************/ VOID MNAME(Hidd_BitMap__PutImageLUT)(OOP_Class *cl, OOP_Object *o, struct pHidd_BitMap_PutImageLUT *msg) { - EnterFunc( - bug("X11Gfx.BitMap::PutImage(pa=%p, x=%d, y=%d, w=%d, h=%d)\n", msg->pixels, msg->x, msg->y, msg->width, + D(bug("[X11Bm] %s(pa=%p, x=%d, y=%d, w=%d, h=%d)\n", __PRETTY_FUNCTION__, msg->pixels, msg->x, msg->y, msg->width, msg->height)); #if USE_XSHM @@ -1284,8 +1312,6 @@ VOID MNAME(Hidd_BitMap__PutImageLUT)(OOP_Class *cl, OOP_Object *o, struct pHidd_ { putimage_xlib(cl, o, msg->gc, msg->x, msg->y, msg->width, msg->height, msg->pixels, (APTR(*)()) buf_to_ximage_lut, msg); } - - ReturnVoid("X11Gfx.BitMap::PutImageLUT"); } /****************************************************************************************/ @@ -1295,6 +1321,8 @@ VOID MNAME(Root__Get)(OOP_Class *cl, OOP_Object *o, struct pRoot_Get *msg) struct bitmap_data *data = OOP_INST_DATA(cl, o); ULONG idx; + D(bug("[X11Bm] %s()\n", __PRETTY_FUNCTION__)); + if (IS_X11BM_ATTR(msg->attrID, idx)) { switch (idx) @@ -1316,6 +1344,8 @@ VOID MNAME(Root__Get)(OOP_Class *cl, OOP_Object *o, struct pRoot_Get *msg) BOOL X11BM__Root__Set(OOP_Class *cl, OOP_Object *o, struct pRoot_Set *msg) { + D(bug("[X11Bm] %s()\n", __PRETTY_FUNCTION__)); + #if ADJUST_XWIN_SIZE /* This provides support for framebuffer display mode switching */ struct bitmap_data *data = OOP_INST_DATA(cl, o); @@ -1344,6 +1374,8 @@ VOID MNAME(Hidd_BitMap__DrawLine)(OOP_Class *cl, OOP_Object *o, struct pHidd_Bit struct bitmap_data *data = OOP_INST_DATA(cl, o); OOP_Object *gc = msg->gc; + D(bug("[X11Bm] %s()\n", __PRETTY_FUNCTION__)); + if (GC_LINEPAT(gc) != (UWORD) ~0) { OOP_DoSuperMethod(cl, o, (OOP_Msg) msg); @@ -1385,13 +1417,15 @@ VOID MNAME(Hidd_BitMap__DrawEllipse)(OOP_Class *cl, OOP_Object *o, struct pHidd_ struct bitmap_data *data = OOP_INST_DATA(cl, o); OOP_Object *gc = msg->gc; + D(bug("[X11Bm] %s()\n", __PRETTY_FUNCTION__)); + LOCK_X11 if (GC_DOCLIP(gc)) { XRectangle cr; - /* kprintf("X11::Drawllipse: clip %d %d %d %d\n" + /* bug("X11::Drawllipse: clip %d %d %d %d\n" , GC_CLIPX1(gc), GC_CLIPY1(gc), GC_CLIPX2(gc), GC_CLIPY2(gc)); */ @@ -1406,7 +1440,7 @@ VOID MNAME(Hidd_BitMap__DrawEllipse)(OOP_Class *cl, OOP_Object *o, struct pHidd_ XCALL(XSetForeground, data->display, data->gc, GC_FG(gc)); XCALL(XSetFunction, data->display, data->gc, GC_DRMD(gc)); - /* kprintf("X11::Drawllipse: coord %d %d %d %d\n" + /* bug("X11::Drawllipse: coord %d %d %d %d\n" , msg->x, msg->y, msg->rx, msg->ry); */ @@ -1427,6 +1461,8 @@ VOID MNAME(Hidd_BitMap__UpdateRect)(OOP_Class *cl, OOP_Object *o, struct pHidd_B { struct bitmap_data *data = OOP_INST_DATA(cl, o); + D(bug("[X11Bm] %s()\n", __PRETTY_FUNCTION__)); + LOCK_X11 if (data->flags & BMDF_FRAMEBUFFER) diff --git a/arch/all-hosted/hidd/x11/fullscreen.c b/arch/all-hosted/hidd/x11/fullscreen.c index 6f76d3934b..39a5f2e5e8 100644 --- a/arch/all-hosted/hidd/x11/fullscreen.c +++ b/arch/all-hosted/hidd/x11/fullscreen.c @@ -1,5 +1,5 @@ /* - Copyright © 1995-2012, The AROS Development Team. All rights reserved. + Copyright © 1995-2014, The AROS Development Team. All rights reserved. $Id$ Desc: Enable fullscreen mode. @@ -20,9 +20,6 @@ typedef unsigned char UBYTE; #include -#define DEBUG 0 -#include - #define HAVE_XF86VMODE_H #include "x11_hostlib.h" diff --git a/arch/all-hosted/hidd/x11/offbitmap.c b/arch/all-hosted/hidd/x11/offbitmap.c index f35e45c2a1..684cda0368 100644 --- a/arch/all-hosted/hidd/x11/offbitmap.c +++ b/arch/all-hosted/hidd/x11/offbitmap.c @@ -1,5 +1,5 @@ /* - Copyright © 1995-2011, The AROS Development Team. All rights reserved. + Copyright © 1995-2014, The AROS Development Team. All rights reserved. $Id$ Desc: Offscreen bitmap class for X11 hidd. @@ -8,6 +8,7 @@ /****************************************************************************************/ +#include "x11_debug.h" #include #include @@ -28,10 +29,6 @@ #include #include -#define SDEBUG 0 -#define DEBUG 0 -#include - #include "x11gfx_intern.h" #include "x11.h" #include "bitmap.h" @@ -45,6 +42,8 @@ BOOL X11BM_InitPM(OOP_Class *cl, OOP_Object *o, struct TagItem *attrList) IPTR depth; struct bitmap_data *data = OOP_INST_DATA(cl, o); + D(bug("[X11OffBm] %s()\n", __PRETTY_FUNCTION__)); + /* Retrieve bitmap size from superclass */ OOP_GetAttr(o, aHidd_BitMap_Width , &data->width); OOP_GetAttr(o, aHidd_BitMap_Height, &data->height); @@ -77,7 +76,7 @@ BOOL X11BM_InitPM(OOP_Class *cl, OOP_Object *o, struct TagItem *attrList) data->width += 32; } - D(bug("Creating X Pixmap, 0x%p, %ld, %ld, %ld\n", friend_drawable, data->width, data->height, depth)); + D(bug("[X11OffBm] %s: Creating X Pixmap, 0x%p, %ld, %ld, %ld\n", __PRETTY_FUNCTION__, friend_drawable, data->width, data->height, depth)); HostLib_Lock(); @@ -93,7 +92,7 @@ BOOL X11BM_InitPM(OOP_Class *cl, OOP_Object *o, struct TagItem *attrList) VOID X11BM_DisposePM(struct bitmap_data *data) { - EnterFunc(bug("X11Gfx.BitMap::DisposePM()\n")); + D(bug("[X11OffBm] %s()\n", __PRETTY_FUNCTION__)); if (DRAWABLE(data)) { @@ -104,13 +103,14 @@ VOID X11BM_DisposePM(struct bitmap_data *data) HostLib_Unlock(); } - ReturnVoid("X11Gfx.BitMap::DisposePM"); } /****************************************************************************************/ VOID X11BM_ClearPM(struct bitmap_data *data, HIDDT_Pixel bg) -{ +{ + D(bug("[X11OffBm] %s()\n", __PRETTY_FUNCTION__)); + XCALL(XSetForeground, data->display, data->gc, bg); - XCALL(XFillRectangle, data->display, DRAWABLE(data), data->gc, 0, 0, data->width, data->height); + XCALL(XFillRectangle, data->display, DRAWABLE(data), data->gc, 0, 0, data->width, data->height); } diff --git a/arch/all-hosted/hidd/x11/onbitmap.c b/arch/all-hosted/hidd/x11/onbitmap.c index e2b2f4a41e..d894084570 100644 --- a/arch/all-hosted/hidd/x11/onbitmap.c +++ b/arch/all-hosted/hidd/x11/onbitmap.c @@ -1,17 +1,18 @@ /* - Copyright © 1995-2013, The AROS Development Team. All rights reserved. + Copyright © 1995-2014, The AROS Development Team. All rights reserved. $Id$ Desc: Bitmap class for X11 hidd. Lang: English. */ +#include "x11_debug.h" + #include #include #include #include -#include #include #include #include @@ -32,7 +33,7 @@ #define MASTERWIN(data) (data)->masterxwindow #define ROOTWIN(data) (data)->masterxwindow #else -#define MASTERWIN(data) WINDRAWABLE(data) +#define MASTERWIN WINDRAWABLE #define ROOTWIN(data) rootwin #endif @@ -55,7 +56,7 @@ BOOL X11BM_InitFB(OOP_Class *cl, OOP_Object *o, struct TagItem *attrList) struct bitmap_data *data = OOP_INST_DATA(cl, o); struct x11_staticdata *xsd = XSD(cl); - EnterFunc(bug("X11Gfx.BitMap::InitFB()\n")); + D(bug("[X11OnBm] %s()\n", __PRETTY_FUNCTION__)); /* stegerg */ visualclass = GetTagData(aHidd_X11BitMap_VisualClass, TrueColor, attrList); @@ -82,15 +83,16 @@ BOOL X11BM_InitFB(OOP_Class *cl, OOP_Object *o, struct TagItem *attrList) */ OOP_GetAttr(o, aHidd_BitMap_ModeID, &modeid); OOP_GetAttr(o, aHidd_BitMap_GfxHidd, (IPTR *) &data->gfxhidd); - D(bug("[X11FB] ModeID 0x%08X, driver 0x%p\n", modeid, data->gfxhidd)); + D(bug("[X11OnBm] ModeID 0x%08X, driver @ 0x%p\n", modeid, data->gfxhidd)); HIDD_Gfx_GetMode(data->gfxhidd, modeid, &sync, &pixfmt); OOP_GetAttr(sync, aHidd_Sync_HDisp, &data->width); OOP_GetAttr(sync, aHidd_Sync_VDisp, &data->height); + depth = DefaultDepth(GetSysDisplay(), GetSysScreen()); /* Open an X window to be used for viewing */ - D(bug("[X11FB] Framebuffer window size %ldx%ld\n", data->width, data->height)); + D(bug("[X11OnBm] Framebuffer window size %ldx%ldx%d\n", data->width, data->height, depth)); /* Listen for all sorts of events */ winattr.event_mask = ButtonPressMask | ButtonReleaseMask | PointerMotionMask @@ -109,7 +111,6 @@ BOOL X11BM_InitFB(OOP_Class *cl, OOP_Object *o, struct TagItem *attrList) rootwin = DefaultRootWindow(GetSysDisplay()); D(bug("Creating XWindow: root win=%p\n", rootwin)); - depth = DefaultDepth(GetSysDisplay(), GetSysScreen()); valuemask = CWCursor | CWEventMask | CWBackPixel; @@ -156,6 +157,7 @@ BOOL X11BM_InitFB(OOP_Class *cl, OOP_Object *o, struct TagItem *attrList) if (MASTERWIN(data)) #endif + { WINDRAWABLE(data) = XCALL(XCreateWindow, GetSysDisplay(), ROOTWIN(data), 0, /* leftedge */ @@ -165,12 +167,13 @@ BOOL X11BM_InitFB(OOP_Class *cl, OOP_Object *o, struct TagItem *attrList) 0, /* BorderWidth */ depth, InputOutput, - DefaultVisual (GetSysDisplay(), GetSysScreen()), + DefaultVisual(GetSysDisplay(), GetSysScreen()), valuemask, &winattr); + } HostLib_Unlock(); - D(bug("[X11FB] Xwindow: 0x%p\n", WINDRAWABLE(data))); + D(bug("[X11OnBm] X Window @ 0x%p\n", WINDRAWABLE(data))); if (WINDRAWABLE(data)) { @@ -227,8 +230,6 @@ BOOL X11BM_InitFB(OOP_Class *cl, OOP_Object *o, struct TagItem *attrList) DRAWABLE(data) = XCALL(XCreatePixmap, data->display, WINDRAWABLE(data), data->width, data->height, depth); } - D(bug("Calling XMapRaised\n")); - /* * stegerg: XMapRaised is now called inside the X11 task when getting * the NOTY_MAPWINDOW message, otherwise the X11 task can @@ -274,10 +275,12 @@ BOOL X11BM_InitFB(OOP_Class *cl, OOP_Object *o, struct TagItem *attrList) XCALL(XSync, GetSysDisplay(), FALSE); HostLib_Unlock(); + D(bug("[X11] %s: notifying port @ 0x%p\n", __PRETTY_FUNCTION__, xsd->x11task_notify_port)); X11DoNotify(xsd, &msg); if (!(XSD(cl)->options & OPTION_DELAYXWINMAPPING)) { + D(bug("[X11OnBm] %s: notifying x11 task to map window..\n", __PRETTY_FUNCTION__)); /* * Send a message to the X11 task to ask when the window has been mapped. * We change only notify_type, other fields are already set. @@ -288,8 +291,8 @@ BOOL X11BM_InitFB(OOP_Class *cl, OOP_Object *o, struct TagItem *attrList) XCALL(XSync, GetSysDisplay(), FALSE); HostLib_Unlock(); + D(bug("[X11] %s: notifying port @ 0x%p\n", __PRETTY_FUNCTION__, xsd->x11task_notify_port)); X11DoNotify(xsd, &msg); - D(kprintf("NOTY_MAPWINDOW request done\n")); } DeleteMsgPort(port); @@ -305,7 +308,7 @@ BOOL X11BM_InitFB(OOP_Class *cl, OOP_Object *o, struct TagItem *attrList) VOID X11BM_DisposeFB(struct bitmap_data *data, struct x11_staticdata *xsd) { - EnterFunc(bug("X11Gfx.BitMap::DisposePM()\n")); + D(bug("[X11OnBm] %s()\n", __PRETTY_FUNCTION__)); if (WINDRAWABLE(data)) { @@ -316,7 +319,8 @@ VOID X11BM_DisposeFB(struct bitmap_data *data, struct x11_staticdata *xsd) if (NULL == port) { - D(kprintf("COULD NOT CREATE PORT OR ALLOCATE MEM IN onbitmap_dispose()\n")); + D(bug("[X11OnBm] %s: failed to create notification message port!\n", __PRETTY_FUNCTION__)); + return; } @@ -326,9 +330,9 @@ VOID X11BM_DisposeFB(struct bitmap_data *data, struct x11_staticdata *xsd) msg.masterxwindow = MASTERWIN(data); msg.execmsg.mn_ReplyPort = port; + D(bug("[X11] %s: notifying port @ 0x%p\n", __PRETTY_FUNCTION__, xsd->x11task_notify_port)); X11DoNotify(xsd, &msg); DeleteMsgPort(port); - } /* Dispose everything */ @@ -351,8 +355,6 @@ VOID X11BM_DisposeFB(struct bitmap_data *data, struct x11_staticdata *xsd) XCALL(XFlush, GetSysDisplay()); HostLib_Unlock(); - - ReturnVoid("X11Gfx.BitMap::DisposeFB"); } /****************************************************************************************/ @@ -364,11 +366,15 @@ BOOL X11BM_SetMode(struct bitmap_data *data, HIDDT_ModeID modeid, { OOP_Object *sync, *pf; + D(bug("[X11OnBm] %s()\n", __PRETTY_FUNCTION__)); + if (HIDD_Gfx_GetMode(data->gfxhidd, (HIDDT_ModeID) modeid, &sync, &pf)) { struct MsgPort *port; IPTR new_width, new_height; + D(bug("[X11OnBm] %s: got mode info\n", __PRETTY_FUNCTION__)); + OOP_GetAttr(sync, aHidd_Sync_HDisp, &new_width); OOP_GetAttr(sync, aHidd_Sync_VDisp, &new_height); @@ -377,7 +383,10 @@ BOOL X11BM_SetMode(struct bitmap_data *data, HIDDT_ModeID modeid, * Prevents badly looking flashing, at least on Darwin. */ if (!(xsd->options & OPTION_DELAYXWINMAPPING) && (new_width == data->width) && (new_height == data->height)) + { + D(bug("[X11OnBm] %s: no change ..\n", __PRETTY_FUNCTION__)); return TRUE; + } port = CreateMsgPort(); if (port) @@ -393,6 +402,7 @@ BOOL X11BM_SetMode(struct bitmap_data *data, HIDDT_ModeID modeid, nmsg.height = new_height; nmsg.execmsg.mn_ReplyPort = port; + D(bug("[X11] %s: notifying port @ 0x%p\n", __PRETTY_FUNCTION__, xsd->x11task_notify_port)); X11DoNotify(xsd, &nmsg); DeleteMsgPort(port); @@ -414,6 +424,8 @@ VOID X11BM_ClearFB(struct bitmap_data *data, HIDDT_Pixel bg) { XSetWindowAttributes winattr; + D(bug("[X11OnBm] %s()\n", __PRETTY_FUNCTION__)); + winattr.background_pixel = bg; XCALL(XChangeWindowAttributes, data->display, WINDRAWABLE(data), CWBackPixel, &winattr); @@ -425,6 +437,8 @@ VOID X11BM_ClearFB(struct bitmap_data *data, HIDDT_Pixel bg) VOID X11BM_ExposeFB(struct bitmap_data *data, WORD x, WORD y, WORD width, WORD height) { + D(bug("[X11OnBm] %s()\n", __PRETTY_FUNCTION__)); + if (!(data->flags & BMDF_BACKINGSTORE)) { XCALL(XSetFunction, data->display, data->gc, GXcopy); @@ -443,6 +457,8 @@ VOID X11BM_InitEmptyCursor(struct bitmap_data *data) Pixmap p, mask; int width, height; + D(bug("[X11OnBm] %s()\n", __PRETTY_FUNCTION__)); + width = height = 1; LOCK_X11 @@ -532,6 +548,8 @@ static Pixmap init_icon(Display *d, Window w, Colormap cm, LONG depth, LONG red_shift, green_shift, blue_shift; GC gc; + D(bug("[X11OnBm] %s()\n", __PRETTY_FUNCTION__)); + red_shift = 24 - xsd->red_shift; green_shift = 24 - xsd->green_shift; blue_shift = 24 - xsd->blue_shift; diff --git a/arch/all-hosted/hidd/x11/support.c b/arch/all-hosted/hidd/x11/support.c index 6fe6d5e6fb..ae0a5302aa 100644 --- a/arch/all-hosted/hidd/x11/support.c +++ b/arch/all-hosted/hidd/x11/support.c @@ -1,11 +1,13 @@ /* - Copyright © 1995-2005, The AROS Development Team. All rights reserved. + Copyright © 1995-2014, The AROS Development Team. All rights reserved. $Id$ Desc: X11 gfx HIDD for AROS. Lang: English. */ +#include "x11_debug.h" + #include #include @@ -13,7 +15,6 @@ #include #include -#include #include "x11gfx_intern.h" #include "x11.h" diff --git a/arch/all-hosted/hidd/x11/x11.c b/arch/all-hosted/hidd/x11/x11.c index e405a828cc..6bc85ed8b7 100644 --- a/arch/all-hosted/hidd/x11/x11.c +++ b/arch/all-hosted/hidd/x11/x11.c @@ -1,11 +1,12 @@ /* - Copyright © 1995-2013, The AROS Development Team. All rights reserved. + Copyright © 1995-2014, The AROS Development Team. All rights reserved. $Id$ Desc: X11 hidd. Connects to the X server and receives events. Lang: English. */ +#include "x11_debug.h" #include #include @@ -48,8 +49,6 @@ #include "fullscreen.h" #include "x11gfx_intern.h" -#include - VOID X11BM_ExposeFB(APTR data, WORD x, WORD y, WORD width, WORD height); /****************************************************************************************/ @@ -83,6 +82,8 @@ AROS_INTH1(x11VBlank, struct Task *, task) { AROS_INTFUNC_INIT + D(bug("[X11] %s()\n", __PRETTY_FUNCTION__)); + Signal(task, SIGBREAKF_CTRL_D); return FALSE; @@ -94,24 +95,36 @@ AROS_INTH1(x11VBlank, struct Task *, task) VOID x11task_entry(struct x11task_params *xtpparam) { - struct x11_staticdata *xsd; + ULONG notifysig; struct MinList nmsg_list; struct MinList xwindowlist; - struct x11task_params xtp; ULONG hostclipboardmask; BOOL f12_down = FALSE; KeySym ks; + /* copy needed parameter's because they are allocated on the parent's stack */ + + struct Task *task_Parent = xtpparam->parent; + ULONG task_SigKill = xtpparam->kill_signal; + struct x11_staticdata *xsd = xtpparam->xsd; + struct Interrupt myint; - /* We must copy the parameter struct because they are allocated - on the parent's stack */ - xtp = *xtpparam; - xsd = xtp.xsd; + D(bug("[X11] %s()\n", __PRETTY_FUNCTION__)); xsd->x11task_notify_port = CreateMsgPort(); if (NULL == xsd->x11task_notify_port) - goto failexit; + { + D(bug("[X11] %s: failed to create notification port!\n", __PRETTY_FUNCTION__)); + Signal(task_Parent, xtpparam->fail_signal); + return; + } + + D(bug("[X11] %s: notification port @ 0x%p\n", __PRETTY_FUNCTION__, xsd->x11task_notify_port)); + + notifysig = 1L << xsd->x11task_notify_port->mp_SigBit; + + D(bug("[X11] %s: notficiation signal = %08x (bit %d)\n", __PRETTY_FUNCTION__, notifysig, xsd->x11task_notify_port->mp_SigBit)); NEWLIST(&nmsg_list); NEWLIST(&xwindowlist); @@ -124,7 +137,9 @@ VOID x11task_entry(struct x11task_params *xtpparam) AddIntServer(INTB_VERTB, &myint); - Signal(xtp.parent, xtp.ok_signal); + Signal(task_Parent, xtpparam->ok_signal); + + /* N.B : do not attempt to use xtpparam after this point! */ hostclipboardmask = x11clipboard_init(xsd); @@ -136,16 +151,23 @@ VOID x11task_entry(struct x11task_params *xtpparam) BOOL keyrelease_pending = FALSE; #endif struct notify_msg *nmsg; - ULONG notifysig = 1L << xsd->x11task_notify_port->mp_SigBit; ULONG sigs; - sigs = Wait(SIGBREAKF_CTRL_D | notifysig | xtp.kill_signal| hostclipboardmask); + D(bug("[X11] %s: waiting for signals..\n", __PRETTY_FUNCTION__)); - if (sigs & xtp.kill_signal) - goto failexit; + sigs = Wait(SIGBREAKF_CTRL_D | notifysig | task_SigKill| hostclipboardmask); + + D(bug("[X11] %s: signal %08x received\n", __PRETTY_FUNCTION__, sigs)); + + if (sigs & task_SigKill) + { + D(bug("[X11] %s: kill signal received - exiting\n", __PRETTY_FUNCTION__)); + break; + } if (sigs & notifysig) { + D(bug("[X11] %s: notification signal received\n", __PRETTY_FUNCTION__)); while ((nmsg = (struct notify_msg *) GetMsg(xsd->x11task_notify_port))) { @@ -154,132 +176,133 @@ VOID x11task_entry(struct x11task_params *xtpparam) switch (nmsg->notify_type) { case NOTY_WINCREATE: - { - struct xwinnode * node; - /* Maintain a list of open windows for the X11 event handler in x11.c */ + { + struct xwinnode * node; + /* Maintain a list of open windows for the X11 event handler in x11.c */ - node = AllocMem(sizeof(struct xwinnode), MEMF_CLEAR); + D(bug("[X11] %s: NOTY_WINCREATE\n", __PRETTY_FUNCTION__)); - if (NULL != node) - { - node->xwindow = nmsg->xwindow; - node->bmobj = nmsg->bmobj; - AddTail((struct List *) &xwindowlist, (struct Node *) node); - } - else - { - kprintf("!!!! CANNOT GET MEMORY FOR X11 WIN NODE\n"); - CCALL(raise, 19); - } + node = AllocMem(sizeof(struct xwinnode), MEMF_CLEAR); - ReplyMsg((struct Message *) nmsg); - break; - } + if (NULL != node) + { + node->xwindow = nmsg->xwindow; + node->bmobj = nmsg->bmobj; + AddTail((struct List *) &xwindowlist, (struct Node *) node); + } + else + { + bug("!!!! CANNOT GET MEMORY FOR X11 WIN NODE\n"); + CCALL(raise, 19); + } + ReplyMsg((struct Message *) nmsg); + break; + } case NOTY_MAPWINDOW: - LOCK_X11 - XCALL(XMapWindow, nmsg->xdisplay, nmsg->xwindow); + { + D(bug("[X11] %s: NOTY_MAPWINDOW Window @ 0x%p (Display = 0x%p)\n", __PRETTY_FUNCTION__, nmsg->xwindow, nmsg->xdisplay)); + + LOCK_X11 + XCALL(XMapWindow, nmsg->xdisplay, nmsg->xwindow); #if ADJUST_XWIN_SIZE - XCALL(XMapRaised, nmsg->xdisplay, nmsg->masterxwindow); + XCALL(XMapRaised, nmsg->xdisplay, nmsg->masterxwindow); #endif - UNLOCK_X11 + UNLOCK_X11 - AddTail((struct List *) &nmsg_list, (struct Node *) nmsg); - - /* Do not reply message yet */ - break; + AddTail((struct List *) &nmsg_list, (struct Node *) nmsg); + /* Do not reply message yet */ + break; + } case NOTY_RESIZEWINDOW: - { - XWindowChanges xwc; - XSizeHints sizehint; - BOOL replymsg = TRUE; + { + XWindowChanges xwc; + XSizeHints sizehint; + BOOL replymsg = TRUE; - xwc.width = nmsg->width; - xwc.height = nmsg->height; + D(bug("[X11] %s: NOTY_RESIZEWINDOW\n", __PRETTY_FUNCTION__)); - sizehint.flags = PMinSize | PMaxSize; - sizehint.min_width = nmsg->width; - sizehint.min_height = nmsg->height; - sizehint.max_width = nmsg->width; - sizehint.max_height = nmsg->height; + xwc.width = nmsg->width; + xwc.height = nmsg->height; - LOCK_X11 - if (xsd->options & OPTION_FULLSCREEN) - { - x11_fullscreen_switchmode(nmsg->xdisplay, &xwc.width, &xwc.height); - } + sizehint.flags = PMinSize | PMaxSize; + sizehint.min_width = nmsg->width; + sizehint.min_height = nmsg->height; + sizehint.max_width = nmsg->width; + sizehint.max_height = nmsg->height; - XCALL(XSetWMNormalHints, nmsg->xdisplay, nmsg->masterxwindow, &sizehint); - XCALL(XConfigureWindow, nmsg->xdisplay, nmsg->masterxwindow, CWWidth | CWHeight, &xwc); - XCALL(XFlush, nmsg->xdisplay); - UNLOCK_X11 + LOCK_X11 + if (xsd->options & OPTION_FULLSCREEN) + { + x11_fullscreen_switchmode(nmsg->xdisplay, &xwc.width, &xwc.height); + } - if (xsd->options & OPTION_DELAYXWINMAPPING) - { - struct xwinnode *node; - ForeachNode(&xwindowlist, node) + XCALL(XSetWMNormalHints, nmsg->xdisplay, nmsg->masterxwindow, &sizehint); + XCALL(XConfigureWindow, nmsg->xdisplay, nmsg->masterxwindow, CWWidth | CWHeight, &xwc); + XCALL(XFlush, nmsg->xdisplay); + UNLOCK_X11 + + if (xsd->options & OPTION_DELAYXWINMAPPING) { - if (node->xwindow == nmsg->xwindow) + struct xwinnode *node; + ForeachNode(&xwindowlist, node) { - if (!node->window_mapped) + if (node->xwindow == nmsg->xwindow) { - LOCK_X11 - XCALL(XMapWindow, nmsg->xdisplay, nmsg->xwindow); + if (!node->window_mapped) + { + LOCK_X11 + XCALL(XMapWindow, nmsg->xdisplay, nmsg->xwindow); #if ADJUST_XWIN_SIZE - XCALL(XMapRaised, nmsg->xdisplay, nmsg->masterxwindow); + XCALL(XMapRaised, nmsg->xdisplay, nmsg->masterxwindow); #endif - if (xsd->options & OPTION_FULLSCREEN) - { - XCALL(XGrabKeyboard, nmsg->xdisplay, nmsg->xwindow, False, GrabModeAsync, GrabModeAsync, CurrentTime); - XCALL(XGrabPointer, nmsg->xdisplay, nmsg->xwindow, 1, PointerMotionMask | ButtonPressMask | ButtonReleaseMask, GrabModeAsync, GrabModeAsync, nmsg->xwindow, None, CurrentTime); - } + if (xsd->options & OPTION_FULLSCREEN) + { + XCALL(XGrabKeyboard, nmsg->xdisplay, nmsg->xwindow, False, GrabModeAsync, GrabModeAsync, CurrentTime); + XCALL(XGrabPointer, nmsg->xdisplay, nmsg->xwindow, 1, PointerMotionMask | ButtonPressMask | ButtonReleaseMask, GrabModeAsync, GrabModeAsync, nmsg->xwindow, None, CurrentTime); + } - XCALL(XFlush, nmsg->xdisplay); - UNLOCK_X11 + XCALL(XFlush, nmsg->xdisplay); + UNLOCK_X11 - nmsg->notify_type = NOTY_MAPWINDOW; - AddTail((struct List *) &nmsg_list, (struct Node *) nmsg); + nmsg->notify_type = NOTY_MAPWINDOW; + AddTail((struct List *) &nmsg_list, (struct Node *) nmsg); - /* Do not reply message yet */ - replymsg = FALSE; + /* Do not reply message yet */ + replymsg = FALSE; - break; + break; + } } } } - } - - if (replymsg) - ReplyMsg((struct Message *) nmsg); - break; - } + if (replymsg) + ReplyMsg((struct Message *) nmsg); + break; + } case NOTY_WINDISPOSE: - { - struct xwinnode *node, *safe; - - ForeachNodeSafe(&xwindowlist, node, safe) { - if (node->xwindow == nmsg->xwindow) + struct xwinnode *node, *safe; + + D(bug("[X11] %s: NOTY_WINDISPOSE\n", __PRETTY_FUNCTION__)); + + ForeachNodeSafe(&xwindowlist, node, safe) { - Remove((struct Node *) node); - FreeMem(node, sizeof(struct xwinnode)); + if (node->xwindow == nmsg->xwindow) + { + Remove((struct Node *) node); + FreeMem(node, sizeof(struct xwinnode)); + } } + ReplyMsg((struct Message *) nmsg); + break; } - - ReplyMsg((struct Message *) nmsg); - - break; - } - } /* switch() */ - } /* while () */ - //continue; - } /* if (message from notify port) */ if (sigs & hostclipboardmask) @@ -423,7 +446,7 @@ VOID x11task_entry(struct x11task_params *xtpparam) break; case ConfigureRequest: - kprintf("!!! CONFIGURE REQUEST !!\n"); + bug("!!! CONFIGURE REQUEST !!\n"); break; #if 0 @@ -606,16 +629,11 @@ VOID x11task_entry(struct x11task_params *xtpparam) } /* Forever */ - failexit: /* Also try to free window node list ? */ - if (xsd->x11task_notify_port) { DeleteMsgPort(xsd->x11task_notify_port); } - - Signal(xtp.parent, xtp.fail_signal); - } /****************************************************************************************/ @@ -624,17 +642,23 @@ struct Task *create_x11task(struct x11task_params *params) { struct Task *task; + D(bug("[X11] %s()\n", __PRETTY_FUNCTION__)); + task = NewCreateTask(TASKTAG_PC, x11task_entry, TASKTAG_STACKSIZE, XTASK_STACKSIZE, TASKTAG_NAME, XTASK_NAME, TASKTAG_PRI, XTASK_PRIORITY, TASKTAG_ARG1, params, TAG_DONE); if (task) { + D(bug("[X11] %s: task @ 0x%p\n", __PRETTY_FUNCTION__, task)); + /* Everything went OK. Wait for task to initialize */ ULONG sigset; sigset = Wait(params->ok_signal | params->fail_signal); if (sigset & params->ok_signal) { + D(bug("[X11] %s: got ok signal\n", __PRETTY_FUNCTION__)); + return task; } } diff --git a/arch/all-hosted/hidd/x11/x11_debug.h b/arch/all-hosted/hidd/x11/x11_debug.h new file mode 100644 index 0000000000..3b823494be --- /dev/null +++ b/arch/all-hosted/hidd/x11/x11_debug.h @@ -0,0 +1,7 @@ +/* + Copyright © 2014, The AROS Development Team. All rights reserved. + $Id$ +*/ + +#define DEBUG 0 +#include diff --git a/arch/all-hosted/hidd/x11/x11_hostlib.c b/arch/all-hosted/hidd/x11/x11_hostlib.c index b2225d4604..74d66fdece 100644 --- a/arch/all-hosted/hidd/x11/x11_hostlib.c +++ b/arch/all-hosted/hidd/x11/x11_hostlib.c @@ -3,6 +3,8 @@ $Id$ */ +#include "x11_debug.h" + #include #include "x11gfx_intern.h" @@ -14,9 +16,6 @@ #include LC_LIBDEFS_FILE -#define DEBUG 0 -#include - void *x11_handle = NULL; void *libc_handle = NULL; void *xf86vm_handle = NULL; @@ -147,38 +146,40 @@ static const char *libc_func_names[] = { void *HostLibBase; -void *x11_hostlib_load_so(const char *sofile, const char **names, int nfuncs, void **funcptr) { +void *x11_hostlib_load_so(const char *sofile, const char **names, int nfuncs, void **funcptr) +{ void *handle; char *err; int i; - D(bug("[x11] loading %d functions from %s\n", nfuncs, sofile)); + D(bug("[X11host] %s('%s')\n", __PRETTY_FUNCTION__, sofile)); + + D(bug("[X11host] %s: attempting to load %d functions\n", __PRETTY_FUNCTION__, nfuncs)); if ((handle = HostLib_Open(sofile, &err)) == NULL) { - kprintf("[x11] couldn't open '%s': %s\n", sofile, err); + bug("[X11host] %s: failed to open '%s': %s\n", __PRETTY_FUNCTION__, sofile, err); return NULL; } for (i = 0; i < nfuncs; i++) { funcptr[i] = HostLib_GetPointer(handle, names[i], &err); - D(bug("%s(%x)\n", names[i], funcptr[i])); + D(bug("[X11host] %s: 0x%p = '%s'\n", __PRETTY_FUNCTION__, funcptr[i], names[i])); if (err != NULL) { - kprintf("[x11] couldn't get symbol '%s' from '%s': %s\n", names[i], sofile, err); + bug("[X11host] %s: failed to get symbol '%s' (%s)\n", __PRETTY_FUNCTION__, names[i], err); HostLib_Close(handle, NULL); return NULL; } } - D(bug("[x11] done\n")); - return handle; } -static int x11_hostlib_init(LIBBASETYPEPTR LIBBASE) { - D(bug("[x11] hostlib init\n")); +static int x11_hostlib_init(LIBBASETYPEPTR LIBBASE) +{ + D(bug("[X11host] %s()\n", __PRETTY_FUNCTION__)); if ((HostLibBase = OpenResource("hostlib.resource")) == NULL) { - kprintf("[x11] couldn't open hostlib.resource\n"); + bug("[X11host] %s: failed to open hostlib.resource!\n", __PRETTY_FUNCTION__); return FALSE; } if ((xf86vm_handle = x11_hostlib_load_so(XF86VM_SOFILE, xf86vm_func_names, XF86VM_NUM_FUNCS, (void **) &xf86vm_func)) == NULL) @@ -195,8 +196,9 @@ static int x11_hostlib_init(LIBBASETYPEPTR LIBBASE) { return TRUE; } -static int x11_hostlib_expunge(LIBBASETYPEPTR LIBBASE) { - D(bug("[x11] hostlib expunge\n")); +static int x11_hostlib_expunge(LIBBASETYPEPTR LIBBASE) +{ + D(bug("[X11host] %s()\n", __PRETTY_FUNCTION__)); if (xf86vm_handle != NULL) HostLib_Close(xf86vm_handle, NULL); diff --git a/arch/all-hosted/hidd/x11/x11_init.c b/arch/all-hosted/hidd/x11/x11_init.c index 6f1e8baf50..ed0f70c698 100644 --- a/arch/all-hosted/hidd/x11/x11_init.c +++ b/arch/all-hosted/hidd/x11/x11_init.c @@ -1,11 +1,13 @@ /* - Copyright © 1995-2013, The AROS Development Team. All rights reserved. + Copyright © 1995-2014, The AROS Development Team. All rights reserved. $Id$ Desc: X11 hidd initialization code. Lang: English. */ +#include "x11_debug.h" + #define __OOP_NOATTRBASES__ #include @@ -26,11 +28,6 @@ #include -#undef SDEBUG -#undef DEBUG -#define DEBUG 0 -#include - #include LC_LIBDEFS_FILE #include "x11.h" @@ -61,6 +58,8 @@ static struct OOP_ABDescr abd[] = static BOOL initclasses(struct x11_staticdata *xsd) { + D(bug("[X11] %s()\n", __PRETTY_FUNCTION__)); + /* Get some attrbases */ if (!OOP_ObtainAttrBases(abd)) @@ -77,6 +76,8 @@ static BOOL initclasses(struct x11_staticdata *xsd) static VOID freeclasses(struct x11_staticdata *xsd) { + D(bug("[X11] %s()\n", __PRETTY_FUNCTION__)); + OOP_ReleaseAttrBases(abd); } @@ -103,7 +104,7 @@ static int MyErrorHandler(Display * display, XErrorEvent * errevent) XCALL(XGetErrorText, display, errevent->error_code, buffer, sizeof (buffer)); Enable(); - kprintf("XError %d (Major=%d, Minor=%d) task = %s\n%s\n", errevent->error_code, errevent->request_code, + bug("XError %d (Major=%d, Minor=%d) task = %s\n%s\n", errevent->error_code, errevent->request_code, errevent->minor_code, FindTask(0)->tc_Node.ln_Name, buffer); return 0; @@ -124,10 +125,11 @@ static int MySysErrorHandler(Display * display) int X11_Init(struct x11_staticdata *xsd) { - D(bug("Entering X11_Init\n")); + D(bug("[X11] %s()\n", __PRETTY_FUNCTION__)); + if (xsd->display) { - D(bug("[X11GFX] Already initialized\n")); + D(bug("[X11] %s: already initialized\n", __PRETTY_FUNCTION__)); return TRUE; } @@ -136,7 +138,8 @@ int X11_Init(struct x11_staticdata *xsd) */ xsd->display = XCALL(XOpenDisplay, NULL); - D(bug("display(%x)\n", xsd->display)); + D(bug("[X11] %s: X display @ 0x%p\n", __PRETTY_FUNCTION__, xsd->display)); + if (xsd->display) { struct x11task_params xtp; @@ -202,6 +205,13 @@ int X11_Init(struct x11_staticdata *xsd) } } + D( + if (xsd->options & OPTION_DELAYXWINMAPPING) + { + D(bug("[X11] %s: option DELAYXWINMAPPING\n", __PRETTY_FUNCTION__)); + } + ) + xsd->delete_win_atom = XCALL(XInternAtom, xsd->display, "WM_DELETE_WINDOW", FALSE); xsd->clipboard_atom = XCALL(XInternAtom, xsd->display, "CLIPBOARD", FALSE); xsd->clipboard_property_atom = XCALL(XInternAtom, xsd->display, "AROS_HOSTCLIP", FALSE); @@ -218,7 +228,7 @@ int X11_Init(struct x11_staticdata *xsd) { if (initclasses(xsd)) { - D(bug("X11_Init succeeded\n")); + D(bug("[X11] %s: task & classes initialized\n", __PRETTY_FUNCTION__)); return TRUE; } @@ -229,7 +239,7 @@ int X11_Init(struct x11_staticdata *xsd) } - D(bug("X11_Init failed\n")); + D(bug("[X11] %s: failed to initialize\n", __PRETTY_FUNCTION__)); return FALSE; } diff --git a/arch/all-hosted/hidd/x11/x11gfx.c b/arch/all-hosted/hidd/x11/x11gfx.c index b855aab42a..8b9b701717 100644 --- a/arch/all-hosted/hidd/x11/x11gfx.c +++ b/arch/all-hosted/hidd/x11/x11gfx.c @@ -1,11 +1,13 @@ /* - Copyright © 1995-2013, The AROS Development Team. All rights reserved. + Copyright © 1995-2014, The AROS Development Team. All rights reserved. $Id$ Desc: X11 gfx HIDD for AROS. Lang: English. */ +#include "x11_debug.h" + #define __OOP_NOATTRBASES__ #include @@ -41,10 +43,6 @@ #include LC_LIBDEFS_FILE -#define SDEBUG 0 -#define DEBUG 0 -#include - #define XFLUSH(x) XCALL(XFlush, x) //#define XFLUSH(x) @@ -275,12 +273,12 @@ OOP_Object *X11Cl__Root__New(OOP_Class *cl, OOP_Object *o, struct pRoot_New *msg ULONG i, screen; Display *disp; - EnterFunc(bug("X11Gfx::New()\n")); + bug("[X11Gfx] %s()\n", __PRETTY_FUNCTION__); /* Do GfxHidd initalization here */ if (!initx11stuff(XSD(cl))) { - kprintf("!!! initx11stuff() FAILED IN X11Gfx::New() !!!\n"); + bug("[X11Gfx] %s: initialisation failed!\n", __PRETTY_FUNCTION__); ReturnPtr("X11Gfx::New()", OOP_Object *, NULL); } @@ -293,15 +291,16 @@ OOP_Object *X11Cl__Root__New(OOP_Class *cl, OOP_Object *o, struct pRoot_New *msg if (!(XSD(cl)->options & OPTION_FORCESTDMODES)) { XVMCALL(XF86VidModeGetAllModeLines, disp, screen, &modeNum, &modes); - D(bug("[X11Gfx] Found %u modes, table at 0x%P\n", modeNum, modes)); + bug("[X11Gfx] Found %u modes, table at 0x%P\n", modeNum, modes); if (modeNum) { /* Got XF86VidMode data, use it */ if ((resolution = AllocMem(modeNum * sizeof(struct TagItem) * 4, MEMF_PUBLIC)) == NULL) { + bug("[X11] failed to allocate memory for %d modes: %d !!!\n", modeNum, XSD(cl)->vi.class); + XCALL(XCloseDisplay, disp); - kprintf("!!! Couldn't allocate resolution memory in X11Gfx:New(): %d !!!\n", XSD(cl)->vi.class); cleanupx11stuff(XSD(cl)); ReturnPtr("X11Gfx::New", OOP_Object *, NULL); } @@ -341,9 +340,10 @@ OOP_Object *X11Cl__Root__New(OOP_Class *cl, OOP_Object *o, struct pRoot_New *msg if((mode_tags = AllocMem(sizeof(struct TagItem) * (realmode + 2), MEMF_PUBLIC)) == NULL) { + bug("[X11] failed to allocate memory for mode tag's: %d !!!\n", XSD(cl)->vi.class); + FreeMem(resolution, modeNum * sizeof(struct TagItem) * 4); XCALL(XCloseDisplay, disp); - kprintf("!!! Couldn't allocate mode_tags memory in X11Gfx:New(): %d !!!\n", XSD(cl)->vi.class); cleanupx11stuff(XSD(cl)); ReturnPtr("X11Gfx::New", OOP_Object *, NULL); } @@ -389,13 +389,13 @@ OOP_Object *X11Cl__Root__New(OOP_Class *cl, OOP_Object *o, struct pRoot_New *msg } else { + bug("[X11Gfx] unsupported color model: %d\n", XSD(cl)->vi.class); if (resolution) { FreeMem(resolution, modeNum * sizeof(struct TagItem) * 4); FreeMem(mode_tags, sizeof(struct TagItem) * (realmode + 2)); } XCALL(XCloseDisplay, disp); - kprintf("!!! UNHANDLED COLOR MODEL IN X11Gfx:New(): %d !!!\n", XSD(cl)->vi.class); cleanupx11stuff(XSD(cl)); ReturnPtr("X11Gfx::New", OOP_Object *, NULL); } @@ -410,11 +410,11 @@ OOP_Object *X11Cl__Root__New(OOP_Class *cl, OOP_Object *o, struct pRoot_New *msg /* We assume chunky */ pftags[15].ti_Data = vHidd_BitMapType_Chunky; - D(bug("Calling super method\n")); - + bug("Calling super method\n"); + o = (OOP_Object *)OOP_DoSuperMethod(cl, o, (OOP_Msg)&mymsg); - - D(bug("Super method called\n")); + + bug("Super method returned\n"); FreeMem(resolution, modeNum * sizeof(struct TagItem) * 4); FreeMem(mode_tags, sizeof(struct TagItem) * (realmode + 2)); @@ -424,13 +424,13 @@ OOP_Object *X11Cl__Root__New(OOP_Class *cl, OOP_Object *o, struct pRoot_New *msg { XColor bg, fg; struct gfx_data *data = OOP_INST_DATA(cl, o); - + LOCK_X11 data->display = XSD(cl)->display; data->screen = DefaultScreen( data->display ); data->depth = DisplayPlanes( data->display, data->screen ); data->colmap = DefaultColormap( data->display, data->screen ); - D(bug("x11_func.XCreateFontCursor(%x), display(%x)\n", x11_func.XCreateFontCursor, data->display)); + bug("x11_func.XCreateFontCursor(%x), display(%x)\n", x11_func.XCreateFontCursor, data->display); /* Create cursor */ data->cursor = XCALL(XCreateFontCursor, data->display, XC_top_left_arrow); @@ -442,7 +442,7 @@ OOP_Object *X11Cl__Root__New(OOP_Class *cl, OOP_Object *o, struct pRoot_New *msg bg.flags = (DoRed | DoGreen | DoBlue); XCALL(XRecolorCursor, data->display, data->cursor, &fg, &bg); - + if (XSD(cl)->options & OPTION_BACKINGSTORE) { switch(DoesBackingStore(ScreenOfDisplay(data->display, data->screen))) @@ -482,24 +482,24 @@ OOP_Object *X11Cl__Root__New(OOP_Class *cl, OOP_Object *o, struct pRoot_New *msg UNLOCK_X11 - D(bug("X11Gfx::New(): Got object from super\n")); + bug("[X11Gfx] Got object from super\n"); data->display = XSD(cl)->display; } - + ReturnPtr("X11Gfx::New", OOP_Object *, o); } /********** GfxHidd::Dispose() ******************************/ VOID X11Cl__Root__Dispose(OOP_Class *cl, OOP_Object *o, OOP_Msg msg) { - EnterFunc(bug("X11Gfx::Dispose(o=%p)\n", o)); - + bug("[X11Gfx] %s(0x%p)\n", __PRETTY_FUNCTION__, o); + cleanupx11stuff(XSD(cl)); - D(bug("X11Gfx::Dispose: calling super\n")); + bug("X11Gfx::Dispose: calling super\n"); OOP_DoSuperMethod(cl, o, msg); - + ReturnVoid("X11Gfx::Dispose"); } @@ -521,8 +521,8 @@ OOP_Object *X11Cl__Hidd_Gfx__NewBitMap(OOP_Class *cl, OOP_Object *o, struct pHid { TAG_IGNORE , 0 }, /* 5 */ { TAG_MORE , 0 } /* 6 */ }; - - EnterFunc(bug("X11Gfx::NewBitMap()\n")); + + bug("[X11Gfx] %s()\n", __PRETTY_FUNCTION__); data = OOP_INST_DATA(cl, o); @@ -558,6 +558,8 @@ VOID X11Cl__Root__Get(OOP_Class *cl, OOP_Object *o, struct pRoot_Get *msg) { ULONG idx; + bug("[X11Gfx] %s()\n", __PRETTY_FUNCTION__); + if (IS_GFX_ATTR(msg->attrID, idx)) { switch (idx) @@ -590,6 +592,8 @@ VOID X11Cl__Root__Set(OOP_Class *cl, OOP_Object *obj, struct pRoot_Set *msg) ULONG idx; struct x11_staticdata *data = XSD(cl); + bug("[X11Gfx] %s()\n", __PRETTY_FUNCTION__); + tstate = msg->attrList; while ((tag = NextTagItem(&tstate))) { @@ -620,6 +624,8 @@ VOID X11Cl__Hidd_Gfx__CopyBox(OOP_Class *cl, OOP_Object *o, struct pHidd_Gfx_Cop struct gfx_data *data = OOP_INST_DATA(cl, o); + bug("[X11Gfx] %s()\n", __PRETTY_FUNCTION__); + mode = GC_DRMD(msg->gc); OOP_GetAttr(msg->src, aHidd_X11BitMap_Drawable, (IPTR *) &src); @@ -650,6 +656,8 @@ VOID X11Cl__Hidd_Gfx__CopyBox(OOP_Class *cl, OOP_Object *o, struct pHidd_Gfx_Cop BOOL X11Cl__Hidd_Gfx__SetCursorShape(OOP_Class *cl, OOP_Object *o, OOP_Msg msg) { + bug("[X11Gfx] %s()\n", __PRETTY_FUNCTION__); + /* Dummy implementation */ return TRUE; } @@ -658,6 +666,8 @@ BOOL X11Cl__Hidd_Gfx__SetCursorShape(OOP_Class *cl, OOP_Object *o, OOP_Msg msg) BOOL X11Cl__Hidd_Gfx__SetCursorPos(OOP_Class *cl, OOP_Object *o, OOP_Msg msg) { + bug("[X11Gfx] %s()\n", __PRETTY_FUNCTION__); + /* Dummy implementation */ return TRUE; } @@ -666,6 +676,8 @@ BOOL X11Cl__Hidd_Gfx__SetCursorPos(OOP_Class *cl, OOP_Object *o, OOP_Msg msg) VOID X11Cl__Hidd_Gfx__SetCursorVisible(OOP_Class *cl, OOP_Object *o, OOP_Msg msg) { + bug("[X11Gfx] %s()\n", __PRETTY_FUNCTION__); + /* Dummy implementation */ return; } @@ -706,7 +718,7 @@ static BOOL initx11stuff(struct x11_staticdata *xsd) int numvisuals; XImage *testimage; - EnterFunc(bug("initx11stuff()\n")); + bug("[X11Gfx] %s()\n", __PRETTY_FUNCTION__); if (!X11_Init(xsd)) return FALSE; @@ -721,13 +733,15 @@ static BOOL initx11stuff(struct x11_staticdata *xsd) if (numvisuals > 1) { - kprintf("!!! GOT MORE THAN ONE VISUAL FROM X !!!\n"); + bug("[X11Gfx] %s: got %d visualinfo from X\n", __PRETTY_FUNCTION__, numvisuals); + // CCALL(raise, SIGSTOP); } if (NULL == visinfo) { - kprintf("!!! COULD NOT GET X VISUAL INFO !!!\n"); + bug("[X11Gfx] %s: no visualinfo available!\n", __PRETTY_FUNCTION__); + CCALL(raise, SIGSTOP); ok = FALSE; @@ -765,7 +779,8 @@ static BOOL initx11stuff(struct x11_staticdata *xsd) break; default: - kprintf("!!! GFX HIDD only supports truecolor and pseudocolor diplays for now !!!\n"); + bug("[X11Gfx] %s: unsupported display mode!\n", __PRETTY_FUNCTION__); + CCALL(raise, SIGSTOP); } @@ -780,15 +795,16 @@ static BOOL initx11stuff(struct x11_staticdata *xsd) RootWindow(xsd->display, DefaultScreen(xsd->display)), &win_attributes)) { - kprintf("!!! X11gfx could not get bits per pixel\n"); + bug("[X11Gfx] %s: failed to obtain bits per pixel\n", __PRETTY_FUNCTION__); + CCALL(raise, SIGSTOP); } xsd->depth = win_attributes.depth; - kprintf("\n"); - kprintf("DisplayPlanes = %d\n", DisplayPlanes(xsd->display, DefaultScreen(xsd->display))); - kprintf("DefaultDepth = %d\n", DefaultDepth(xsd->display, DefaultScreen(xsd->display))); - - kprintf("\n\n BITS PER PIXEL = %d \n\n\n", xsd->depth); + bug("\n"); + bug("[X11Gfx] %s: Display Depth = %dbit (Default = %dbit)\n", __PRETTY_FUNCTION__, DisplayPlanes(xsd->display, DefaultScreen(xsd->display)), DefaultDepth(xsd->display, DefaultScreen(xsd->display))); +#if (0) + bug("[X11Gfx] %s: %d Bits per Pixel\n", __PRETTY_FUNCTION__, xsd->depth); +#endif } /* Create a dummy X image to get bits per pixel */ @@ -803,7 +819,7 @@ static BOOL initx11stuff(struct x11_staticdata *xsd) } else { - kprintf("!!! X11gfx could not get bits per pixel\n"); + bug("[X11Gfx] %s: failed to create query image\n", __PRETTY_FUNCTION__); CCALL(raise, SIGSTOP); } @@ -815,7 +831,6 @@ static BOOL initx11stuff(struct x11_staticdata *xsd) } /* Create a dummy window for pixmaps */ - xsd->dummy_window_for_creating_pixmaps = XCALL(XCreateSimpleWindow, xsd->display, DefaultRootWindow(xsd->display), 0, 0, 100, 100, @@ -824,6 +839,7 @@ static BOOL initx11stuff(struct x11_staticdata *xsd) BlackPixel(xsd->display, DefaultScreen(xsd->display))); if (0 == xsd->dummy_window_for_creating_pixmaps) { + bug("[X11Gfx] %s: failed to create pixmap window\n", __PRETTY_FUNCTION__); ok = FALSE; } @@ -842,7 +858,7 @@ static BOOL initx11stuff(struct x11_staticdata *xsd) if (NULL == xsd->xshm_info) { /* ok = FALSE; */ - kprintf("INITIALIZATION OF XSHM FAILED !!\n"); + bug("INITIALIZATION OF XSHM FAILED !!\n"); } else { @@ -867,6 +883,8 @@ static BOOL initx11stuff(struct x11_staticdata *xsd) static VOID cleanupx11stuff(struct x11_staticdata *xsd) { + bug("[X11Gfx] %s()\n", __PRETTY_FUNCTION__); + LOCK_X11 /* Do nothing for now */ @@ -889,7 +907,7 @@ static VOID cleanupx11stuff(struct x11_staticdata *xsd) static int x11gfx_init(LIBBASETYPEPTR LIBBASE) { - D(bug("[X11] Initializing semaphore 0x%p\n", &LIBBASE->xsd.sema)); + bug("[X11Gfx] %s: initialising semaphore @ 0x%p\n", __PRETTY_FUNCTION__, &LIBBASE->xsd.sema); InitSemaphore(&LIBBASE->xsd.sema); @@ -900,6 +918,8 @@ static int x11gfx_init(LIBBASETYPEPTR LIBBASE) static int x11gfx_expunge(LIBBASETYPEPTR LIBBASE) { + D(bug("[X11Gfx] %s()\n", __PRETTY_FUNCTION__)); + OOP_ReleaseAttrBases(attrbases); return TRUE; } -- 2.11.4.GIT