diff --git a/icons/misc.c b/icons/misc.c index 9e3cf7a3..df9522b3 100644 --- a/icons/misc.c +++ b/icons/misc.c @@ -78,7 +78,12 @@ bm_plus_bits[] = { #undef B +#ifdef __WIN32__ #define F(r, g, b, a) (((b * a) / 0xFF) | ((g * a) / 0xFF) << 8 | ((r * a) / 0xFF) << 16 | a << 24) +#else +#define F(r, g, b, a) ((b) | ((g) << 8) | ((r) << 16) | ((a) << 24)) +#endif + #define G(x) F(107, 194, 96, x) uint32_t bm_online_bits[] = { diff --git a/main.h b/main.h index 6d0b7670..9fe3ea5e 100644 --- a/main.h +++ b/main.h @@ -105,8 +105,8 @@ enum BM_RESTORE, BM_MAXIMIZE, BM_EXIT, - BM_CORNER, BM_PLUS, + BM_CORNER, BM_ONLINE, BM_AWAY, BM_BUSY, diff --git a/xlib/main.c b/xlib/main.c index 867e6084..fc375f26 100644 --- a/xlib/main.c +++ b/xlib/main.c @@ -189,13 +189,13 @@ void drawvline(int x, int y, int y2, uint32_t color) void fillrect(RECT *r, uint32_t color) { XSetForeground(display, gc, color); - XFillRectangle(display, drawbuf, gc, r->left, r->top, r->right - r->left + 1, r->bottom - r->top + 1); + XFillRectangle(display, drawbuf, gc, r->left, r->top, r->right - r->left, r->bottom - r->top); } void framerect(RECT *r, uint32_t color) { XSetForeground(display, gc, color); - XDrawRectangle(display, drawbuf, gc, r->left, r->top, r->right - r->left, r->bottom - r->top); + XDrawRectangle(display, drawbuf, gc, r->left, r->top, r->right - r->left - 1, r->bottom - r->top - 1); } void setfont(int id) @@ -230,13 +230,13 @@ void setbgcolor(uint32_t color) XSetBackground(display, gc, color); } -//XRectangle clip[16]; -//static int clipk; +static XRectangle clip[16]; +static int clipk; void pushclip(int left, int top, int width, int height) { - /*if(!clipk) { - XSetClipMask(display, gc, drawbuf); + if(!clipk) { + //XSetClipMask(display, gc, drawbuf); } XRectangle *r = &clip[clipk++]; @@ -245,20 +245,23 @@ void pushclip(int left, int top, int width, int height) r->width = width; r->height = height; - XSetClipRectangles(display, gc, 0, 0, r, 1, Unsorted);*/ + XSetClipRectangles(display, gc, 0, 0, r, 1, Unsorted); + XftDrawSetClipRectangles(xftdraw, 0, 0, r, 1); } void popclip(void) { - /*clipk--; + clipk--; if(!clipk) { XSetClipMask(display, gc, None); + XftDrawSetClip(xftdraw, None); return; } XRectangle *r = &clip[clipk - 1]; - XSetClipRectangles(display, gc, 0, 0, r, 1, Unsorted);*/ + XSetClipRectangles(display, gc, 0, 0, r, 1, Unsorted); + XftDrawSetClipRectangles(xftdraw, 0, 0, r, 1); } void enddraw(int x, int y, int width, int height)