diff options
author | Okan Demirmen <okan@cvs.openbsd.org> | 2008-05-17 03:59:56 +0000 |
---|---|---|
committer | Okan Demirmen <okan@cvs.openbsd.org> | 2008-05-17 03:59:56 +0000 |
commit | 74cf1f33517429c2800495bfe44df0e409f10425 (patch) | |
tree | d398622f2979e92e4b69c17601a359114c165753 | |
parent | 34b7609ab2a3489a289ff69005d82e39e0df1d38 (diff) |
fix cwm's current XShape support from Edd Barrett -thanks.
XShape events should be handled at some point.
ok oga@
-rw-r--r-- | app/cwm/calmwm.h | 3 | ||||
-rw-r--r-- | app/cwm/client.c | 40 | ||||
-rw-r--r-- | app/cwm/grab.c | 3 |
3 files changed, 28 insertions, 18 deletions
diff --git a/app/cwm/calmwm.h b/app/cwm/calmwm.h index b5c7bbb00..0d90bdebd 100644 --- a/app/cwm/calmwm.h +++ b/app/cwm/calmwm.h @@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: calmwm.h,v 1.38 2008/05/01 18:01:13 oga Exp $ + * $Id: calmwm.h,v 1.39 2008/05/17 03:59:54 okan Exp $ */ #ifndef _CALMWM_H_ @@ -355,6 +355,7 @@ struct client_ctx *client_mrunext(struct client_ctx *cc); 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 *); diff --git a/app/cwm/client.c b/app/cwm/client.c index 2bc8ac761..06de90c37 100644 --- a/app/cwm/client.c +++ b/app/cwm/client.c @@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: client.c,v 1.21 2008/05/15 22:18:00 oga Exp $ + * $Id: client.c,v 1.22 2008/05/17 03:59:54 okan Exp $ */ #include "headers.h" @@ -139,21 +139,6 @@ client_new(Window win, struct screen_ctx *sc, int mapped) 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); - } - cc->active = 0; client_draw_border(cc); @@ -188,6 +173,27 @@ client_new(Window win, struct screen_ctx *sc, int mapped) 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) { @@ -458,6 +464,8 @@ client_draw_border(struct client_ctx *cc) XClearWindow(X_Dpy, cc->pwin); } + + client_do_shape(cc); } u_long diff --git a/app/cwm/grab.c b/app/cwm/grab.c index 6c2dcccda..027d6ed36 100644 --- a/app/cwm/grab.c +++ b/app/cwm/grab.c @@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: grab.c,v 1.10 2008/05/15 22:18:00 oga Exp $ + * $Id: grab.c,v 1.11 2008/05/17 03:59:55 okan Exp $ */ #include "headers.h" @@ -101,6 +101,7 @@ grab_sweep(struct client_ctx *cc) XReparentWindow(X_Dpy, sc->menuwin, sc->rootwin, 0, 0); xu_ptr_ungrab(); client_ptrwarp(cc); + client_do_shape(cc); return; } } |