X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=src%2Fframe.cc;h=622207ed888b30d57b1cdcad91c796da8818793c;hb=9d5865a1603733e62fda7c8d61024cb05bf6792c;hp=29bb62e926a5755ff6a4ca34dd712e64b927a07b;hpb=209b7f212d18078c82f0faab4094dcd7d8e36850;p=chaz%2Fopenbox diff --git a/src/frame.cc b/src/frame.cc index 29bb62e9..622207ed 100644 --- a/src/frame.cc +++ b/src/frame.cc @@ -4,6 +4,12 @@ # include "../config.h" #endif +extern "C" { +#ifdef SHAPE +#include +#endif // SHAPE +} + #include "frame.hh" #include "client.hh" #include "otk/display.hh" @@ -76,7 +82,45 @@ void OBFrame::resize() void OBFrame::shape() { - // XXX: if shaped, shape the frame to the client.. +#ifdef SHAPE + if (!_client->shaped()) { + // clear the shape on the frame window + XShapeCombineMask(otk::OBDisplay::display, _window, ShapeBounding, + _size.left - 2,//frame.margin.left - frame.border_w, + _size.top - 2,//frame.margin.top - frame.border_w, + None, ShapeSet); + } else { + // make the frame's shape match the clients + XShapeCombineShape(otk::OBDisplay::display, _window, ShapeBounding, + _size.left - 2, + _size.top - 2, + _client->window(), ShapeBounding, ShapeSet); + + int num = 0; + XRectangle xrect[2]; + + /* + if (decorations & Decor_Titlebar) { + xrect[0].x = xrect[0].y = -frame.border_w; + xrect[0].width = frame.rect.width(); + xrect[0].height = frame.title_h + (frame.border_w * 2); + ++num; + } + + if (decorations & Decor_Handle) { + xrect[1].x = -frame.border_w; + xrect[1].y = frame.rect.height() - frame.margin.bottom + + frame.mwm_border_w - frame.border_w; + xrect[1].width = frame.rect.width(); + xrect[1].height = frame.handle_h + (frame.border_w * 2); + ++num; + }*/ + + XShapeCombineRectangles(otk::OBDisplay::display, _window, + ShapeBounding, 0, 0, xrect, num, + ShapeUnion, Unsorted); + } +#endif // SHAPE }