vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Attached diff fixes non-rectangular windows in cwm and also small formatting clean-ups in surrounding code. -- Best Regards Edd http://students.dec.bmth.ac.uk/ebarrett Index: calmwm.h ================================================== ================= RCS file: /cvs/xenocara/app/cwm/calmwm.h,v retrieving revision 1.38 diff -u -r1.38 calmwm.h --- calmwm.h 1 May 2008 18:01:13 -0000 1.38 +++ calmwm.h 9 May 2008 12:53:23 -0000 @@ -355,6 +355,7 @@ struct client_ctx *client_mruprev(struct client_ctx *cc); void client_gethints(struct client_ctx *cc); void client_freehints(struct client_ctx *cc); +void client_do_shape(struct client_ctx *); void xev_handle_maprequest(struct xevent *, XEvent *); void xev_handle_unmapnotify(struct xevent *, XEvent *); Index: client.c ================================================== ================= RCS file: /cvs/xenocara/app/cwm/client.c,v retrieving revision 1.19 diff -u -r1.19 client.c --- client.c 1 May 2008 18:01:13 -0000 1.19 +++ client.c 9 May 2008 12:53:23 -0000 @@ -116,7 +116,8 @@ state = NormalState; XSelectInput(X_Dpy, cc->win, - ColormapChangeMask|EnterWindowMask|PropertyChangeM ask|KeyReleaseMask); + ColormapChangeMask | EnterWindowMask | + PropertyChangeMask | KeyReleaseMask); x = cc->geom.x - cc->bwidth; y = cc->geom.y - cc->bwidth; @@ -131,35 +132,15 @@ pxattr.override_redirect = True; pxattr.background_pixel = sc->bgcolor.pixel; pxattr.event_mask = - ChildMask|ButtonPressMask|ButtonReleaseMask| - ExposureMask|EnterWindowMask; -/* pxattr.border_pixel = sc->blackpix; */ -/* pxattr.background_pixel = sc->whitepix; */ - - -/* cc->pwin = XCreateSimpleWindow(X_Dpy, sc->rootwin, */ -/* x, y, width, height, 1, sc->blackpix, sc->whitepix); */ + ChildMask | ButtonPressMask | ButtonReleaseMask | + ExposureMask | EnterWindowMask; cc->pwin = XCreateWindow(X_Dpy, sc->rootwin, x, y, - width, height, 0, /* XXX */ - DefaultDepth(X_Dpy, sc->which), CopyFromParent, - DefaultVisual(X_Dpy, sc->which), - CWOverrideRedirect | CWBackPixel | CWEventMask, &pxattr); - - if (Doshape) { - XRectangle *r; - int n, tmp; - - XShapeSelectInput(X_Dpy, cc->win, ShapeNotifyMask); - - r = XShapeGetRectangles(X_Dpy, cc->win, ShapeBounding, - &n, &tmp); - if (n > 1) - XShapeCombineShape(X_Dpy, cc->pwin, ShapeBounding, - 0, 0, /* XXX border */ - cc->win, ShapeBounding, ShapeSet); - XFree(r); - } + width, height, 0, /* XXX */ + DefaultDepth(X_Dpy, sc->which), CopyFromParent, + DefaultVisual(X_Dpy, sc->which), + CWOverrideRedirect | CWBackPixel | + CWEventMask, &pxattr); cc->active = 0; client_draw_border(cc); @@ -196,6 +177,27 @@ return (cc); } +void +client_do_shape(struct client_ctx *cc) +{ + /* Windows not rectangular require more effort */ + XRectangle *r; + int n, tmp; + + if (Doshape) { + XShapeSelectInput(X_Dpy, cc->win, ShapeNotifyMask); + + r = XShapeGetRectangles(X_Dpy, cc->win, ShapeBounding, + &n, &tmp); + + if (n > 1) + XShapeCombineShape(X_Dpy, cc->pwin, ShapeBounding, + cc->bwidth, cc->bwidth, + cc->win, ShapeBounding, ShapeSet); + XFree(r); + } +} + int client_delete(struct client_ctx *cc, int sendevent, int ignorewindow) { @@ -466,6 +468,8 @@ XClearWindow(X_Dpy, cc->pwin); } + + client_do_shape(cc); } u_long Index: grab.c ================================================== ================= RCS file: /cvs/xenocara/app/cwm/grab.c,v retrieving revision 1.9 diff -u -r1.9 grab.c --- grab.c 15 Apr 2008 20:24:41 -0000 1.9 +++ grab.c 9 May 2008 12:53:23 -0000 @@ -101,6 +101,7 @@ XReparentWindow(X_Dpy, sc->menuwin, sc->rootwin, 0, 0); xu_ptr_ungrab(); client_ptrwarp(cc); + client_do_shape(cc); return; } } |