diff options
| author | Dana Jansens <danakj@orodu.net> | 2002-11-10 05:54:12 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2002-11-10 05:54:12 +0000 |
| commit | 9d5865a1603733e62fda7c8d61024cb05bf6792c (patch) | |
| tree | 3a2e3286b789104457b3297c4ed4873bb5b05ac7 /src/frame.cc | |
| parent | 209b7f212d18078c82f0faab4094dcd7d8e36850 (diff) | |
support for the shape extension works!
Diffstat (limited to 'src/frame.cc')
| -rw-r--r-- | src/frame.cc | 46 |
1 files changed, 45 insertions, 1 deletions
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 <X11/extensions/shape.h> +#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 } |
