aboutsummaryrefslogtreecommitdiffstats
path: root/client.c
diff options
context:
space:
mode:
authorokan2008-05-17 03:59:54 +0000
committerokan2008-05-17 03:59:54 +0000
commit170f81834e88d241194595a8f05821f23c933477 (patch)
tree08b41548b7976c2ea8ef60fd71fc59bab9f0c402 /client.c
parent6a2c99a2df8d170eda74cccacbb5a5225d617d21 (diff)
downloadcwm-170f81834e88d241194595a8f05821f23c933477.tar.gz
fix cwm's current XShape support from Edd Barrett -thanks.
XShape events should be handled at some point. ok oga@
Diffstat (limited to 'client.c')
-rw-r--r--client.c40
1 files changed, 24 insertions, 16 deletions
diff --git a/client.c b/client.c
index 2bc8ac7..06de90c 100644
--- a/client.c
+++ b/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