void ShapeFrame(UltimateContext *uc) { int a, shaped, wbs, hbs; XShapeQueryExtents(disp,uc->win,&shaped,&a,&a,&wbs,&hbs,&a,&a,&a,&a,&a); if(uc->frame != None) { if(shaped){ uc->flags |= SHAPED; XShapeCombineShape(disp, uc->frame, ShapeBounding, uc->BorderWidth, uc->BorderWidth + TheScreen.TitleHeight, uc->win, ShapeBounding, ShapeSet); if(uc->title.win != None) XShapeCombineShape(disp, uc->frame, ShapeBounding, uc->title.x, uc->title.y , uc->title.win, ShapeBounding, ShapeUnion); XUnmapWindow(disp, uc->border); UpdateName(uc); } else { if(uc->flags & SHAPED) { XShapeCombineMask(disp, uc->frame, ShapeBounding, 0, 0, None, ShapeSet); } uc->flags &= ~SHAPED; XMapWindow(disp, uc->border); UpdateName(uc); } } }
void set_shape(client_t *c) { int n, order; XRectangle temp, *rects; rects = XShapeGetRectangles(dpy, c->win, ShapeBounding, &n, &order); if (n > 1) { XShapeCombineShape(dpy, c->frame, ShapeBounding, 0, frame_height(c), c->win, ShapeBounding, ShapeSet); temp.x = -BW(c); temp.y = -BW(c); temp.width = c->geom.w + 2*BW(c); temp.height = frame_height(c) + BW(c); XShapeCombineRectangles(dpy, c->frame, ShapeBounding, 0, 0, &temp, 1, ShapeUnion, YXBanded); temp.x = 0; temp.y = 0; temp.width = c->geom.w; temp.height = frame_height(c) - BW(c); XShapeCombineRectangles(dpy, c->frame, ShapeClip, 0, frame_height(c), &temp, 1, ShapeUnion, YXBanded); c->shaped = 1; } else if (c->shaped) { /* I can't find a ``remove all shaping'' function... */ temp.x = -BW(c); temp.y = -BW(c); temp.width = c->geom.w + 2*BW(c); temp.height = c->geom.h + frame_height(c) + 2*BW(c); XShapeCombineRectangles(dpy, c->frame, ShapeBounding, 0, 0, &temp, 1, ShapeSet, YXBanded); } XFree(rects); }
static void EShapeCombineShape(Win win, int dest, int x, int y, Win src_win, int src_kind, int op) { if (!win) return; XShapeCombineShape(disp, win->xwin, dest, x, y, src_win->xwin, src_kind, op); EShapeUpdate(win); }
void stealshape(Window w) { XShapeCombineShape (dpy, iconwin, ShapeBounding, 0, 0, w, ShapeBounding, ShapeSet); /* XShapeCombineShape (dpy, win, ShapeBounding, 0, 0, w, */ /* ShapeBounding, ShapeSet); */ /*Re-read specs! */ /* XShapeCombineShape (dpy, win, ShapeClip, 0, 0, w, */ /* ShapeClip, ShapeSet); */ /* XShapeCombineShape (dpy, iconwin, ShapeClip, 0, 0, w, */ /* ShapeClip, ShapeSet); */ }
EAPI void ecore_x_window_shape_window_set(Ecore_X_Window win, Ecore_X_Window shape_win) { LOGFN(__FILE__, __LINE__, __FUNCTION__); XShapeCombineShape(_ecore_x_disp, win, ShapeBounding, 0, 0, shape_win, ShapeBounding, ShapeSet); } /* ecore_x_window_shape_window_set */
void set_shape(Client *c) { int bounding_shaped; int i, b; unsigned int u; /* dummies */ if (!have_shape) return; /* Logic to decide if we have a shaped window cribbed from fvwm-2.5.10. * Previous method (more than one rectangle returned from * XShapeGetRectangles) worked _most_ of the time. */ if (XShapeQueryExtents(dpy, c->window, &bounding_shaped, &i, &i, &u, &u, &b, &i, &i, &u, &u) && bounding_shaped) { LOG_DEBUG("%d shape extents\n", bounding_shaped); XShapeCombineShape(dpy, c->parent, ShapeBounding, 0, 0, c->window, ShapeBounding, ShapeSet); } }
EAPI void ecore_x_window_shape_window_add(Ecore_X_Window win, Ecore_X_Window shape_win) { LOGFN(__FILE__, __LINE__, __FUNCTION__); XShapeCombineShape(_ecore_x_disp, win, ShapeBounding, 0, 0, shape_win, ShapeBounding, ShapeUnion); if (_ecore_xlib_sync) ecore_x_sync(); }
void Frame::reshape() { qDebug() << "Frame reshaped:" << winId() << "Name:" << wm_name << "Client:" << c_win << "State:" << state; shaped = true; XShapeCombineShape(QX11Info::display(), winId(), ShapeBounding, 0, bottom_bdr_height, c_win, ShapeBounding, ShapeSet); XRectangle tr; tr.x = 0; tr.y = 0; tr.width = width(); tr.height = bottom_bdr_height; XShapeCombineRectangles(QX11Info::display(), winId(), ShapeBounding, 0, 0, &tr, 1, ShapeUnion, Unsorted); }
EAPI void ecore_x_window_shape_window_add_xy(Ecore_X_Window win, Ecore_X_Window shape_win, int x, int y) { LOGFN(__FILE__, __LINE__, __FUNCTION__); XShapeCombineShape(_ecore_x_disp, win, ShapeBounding, x, y, shape_win, ShapeBounding, ShapeUnion); } /* ecore_x_window_shape_window_add_xy */
EAPI void ecore_x_window_shape_window_set_xy(Ecore_X_Window win, Ecore_X_Window shape_win, int x, int y) { LOGFN(__FILE__, __LINE__, __FUNCTION__); XShapeCombineShape(_ecore_x_disp, win, ShapeBounding, x, y, shape_win, ShapeBounding, ShapeSet); if (_ecore_xlib_sync) ecore_x_sync(); }
void frame_adjust_shape_kind(struct wm_frame *self, int kind) { gint num; XRectangle xrect[2]; gboolean shaped; shaped = (kind == ShapeBounding && self->client->shaped); shaped |= (kind == ShapeInput && self->client->shaped_input); if(!shaped) { XShapeCombineMask(t_display, self->window, kind, self->size.left, self->size.top, None, ShapeSet); } else { XShapeCombineShape(t_display, self->window, kind, self->size.left, self->size.top, self->client->window, kind, ShapeSet); num = 0; XShapeCombineRectangles(t_display, self->window, ShapeBounding, 0, 0, xrect, num, ShapeUnion, Unsorted); } }
EAPI void ecore_x_window_shape_input_window_set(Ecore_X_Window win, Ecore_X_Window shape_win) { #ifdef ShapeInput LOGFN(__FILE__, __LINE__, __FUNCTION__); XShapeCombineShape(_ecore_x_disp, win, ShapeInput, 0, 0, shape_win, ShapeInput, ShapeSet); #else return; win = shape_win = 0; #endif } /* ecore_x_window_shape_input_window_set */
/*ARGSUSED*/ extern void setShape(Client *c) { #ifdef SHAPE int n; int order; XRectangle *rect; if (shape) { XShapeSelectInput(dpy, c->window, ShapeNotifyMask); rect = XShapeGetRectangles(dpy, c->window, ShapeBounding, &n, &order); if (n > 1) XShapeCombineShape(dpy, c->parent, ShapeBounding, border - 1, border - 1, c->window, ShapeBounding, ShapeSet); XFree(rect); } #else #endif }
EAPI void ecore_x_window_shape_input_window_add_xy(Ecore_X_Window win, Ecore_X_Window shape_win, int x, int y) { #ifdef ShapeInput LOGFN(__FILE__, __LINE__, __FUNCTION__); XShapeCombineShape(_ecore_x_disp, win, ShapeInput, x, y, shape_win, ShapeInput, ShapeUnion); #else return; win = shape_win = x = y = 0; #endif } /* ecore_x_window_shape_input_window_add_xy */
EAPI void ecore_x_window_shape_input_window_set_xy(Ecore_X_Window win, Ecore_X_Window shape_win, int x, int y) { #ifdef ShapeInput LOGFN(__FILE__, __LINE__, __FUNCTION__); XShapeCombineShape(_ecore_x_disp, win, ShapeInput, x, y, shape_win, ShapeInput, ShapeSet); if (_ecore_xlib_sync) ecore_x_sync(); #else return; win = shape_win = x = y = 0; #endif }