From 14939535b6252483d079772e8c32b0032a2cae1e Mon Sep 17 00:00:00 2001 From: dan Date: Mon, 17 Jan 2000 03:07:18 +0000 Subject: [PATCH] Misc bug fixes --- WINGs/wcolorpanel.c | 8 +++++--- src/wmsound.c | 24 +++++++++++++++--------- wrlib/gradient.c | 3 ++- 3 files changed, 22 insertions(+), 13 deletions(-) diff --git a/WINGs/wcolorpanel.c b/WINGs/wcolorpanel.c index fabb0e79..481c5357 100644 --- a/WINGs/wcolorpanel.c +++ b/WINGs/wcolorpanel.c @@ -2160,7 +2160,7 @@ wheelRender(W_ColorPanel *panel) unsigned long ofs = 0; unsigned char shift = getShift(sizeof(unsigned char)); - image = RCreateImage(colorWheelSize+4, colorWheelSize+4, False); + image = RCreateImage(colorWheelSize+4, colorWheelSize+4, True); if (!image) { wwarning(NO_MEMORY_ERR); return; @@ -2180,11 +2180,13 @@ wheelRender(W_ColorPanel *panel) panel->wheelMtrx->data[1][ofs] ]); *(ptr++) = (unsigned char)(panel->wheelMtrx->values[ panel->wheelMtrx->data[2][ofs] ]); + *(ptr++) = 0; } else { *(ptr++) = (unsigned char)(gray.red); *(ptr++) = (unsigned char)(gray.green); *(ptr++) = (unsigned char)(gray.blue); + *(ptr++) = 255; } ofs++; } @@ -3003,8 +3005,8 @@ customPalettePositionSelection(W_ColorPanel *panel, int x, int y) panel->palx = x; panel->paly = y; - ofs = rint(x * panel->palXRatio) + rint(y * panel->palYRatio) * - panel->customPaletteImg->width * 3; + ofs = (rint(x * panel->palXRatio) + rint(y * panel->palYRatio) * + panel->customPaletteImg->width) * 3; panel->color.rgb.red = panel->customPaletteImg->data[ofs]; panel->color.rgb.green = panel->customPaletteImg->data[ofs+1]; diff --git a/src/wmsound.c b/src/wmsound.c index 4ed1911e..3ea9215b 100644 --- a/src/wmsound.c +++ b/src/wmsound.c @@ -37,15 +37,21 @@ wSoundServerGrab(Window wm_win) } XGetClassHint (dpy, lstChildren[indexCount], retHint); - if (retHint->res_class) { - if (strcmp("WMSoundServer", retHint->res_class) == 0) { - soundServer = lstChildren[indexCount]; - XFree(lstChildren); - if(retHint) { - XFree(retHint); - } - return; - } + + if (retHint->res_class) { + if (strcmp("WMSoundServer", retHint->res_class)==0 || + /*strcmp("WSoundServer", retHint->res_class)==0 ||*/ + (retHint->res_name && + strcmp("wsoundserver", retHint->res_name)==0 && + strcmp("DockApp", retHint->res_class)==0)) { + + soundServer = lstChildren[indexCount]; + XFree(lstChildren); + if(retHint) { + XFree(retHint); + } + return; + } } XFree(retHint); retHint = 0; diff --git a/wrlib/gradient.c b/wrlib/gradient.c index 885b3fe6..2997e584 100644 --- a/wrlib/gradient.c +++ b/wrlib/gradient.c @@ -3,6 +3,7 @@ * Raster graphics library * * Copyright (c) 1997-2000 Alfredo K. Kojima + * Copyright (c) 1998-2000 Dan Pascu * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -249,7 +250,7 @@ renderDGradient(unsigned width, unsigned height, int r0, int g0, int b0, return NULL; } - a = (((width - 1)<<16) / ((height - 1)<<16)) * 3; + a = (((width - 1)<<16) / (height - 1)) * 3; width *= 3; /* copy the first line to the other lines with corresponding offset */ -- 2.11.4.GIT