X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=src%2Fframe.cc;h=20e81ebd192d928a034c03aefe81367228ed8fa2;hb=c09095554429d93f2e1f4fef2d6028a523f6206c;hp=d70dad0184f3d658acf4c49c7782ad8c9ad131f7;hpb=410a8264586671256f4a2d1b3095fa6ecffc01bd;p=chaz%2Fopenbox diff --git a/src/frame.cc b/src/frame.cc index d70dad01..20e81ebd 100644 --- a/src/frame.cc +++ b/src/frame.cc @@ -18,7 +18,7 @@ extern "C" { namespace ob { -OBFrame::OBFrame(const OBClient *client, const otk::Style *style) +OBFrame::OBFrame(OBClient *client, const otk::Style *style) : _client(client), _screen(otk::OBDisplay::screenInfo(client->screen())) { @@ -184,6 +184,14 @@ void OBFrame::update() // possible letter, all of the letters are valid, and L exists somewhere in // the string! + // the size of the label. this ASSUMES the layout has only buttons other + // that the ONE LABEL!! + // adds an extra sep so that there's a space on either side of the + // titlebar.. note: x = sep, below. + _label_area.setWidth(_label_area.width() - + ((_button_iconify_area.width() + sep) * + (layout.size() - 1) + sep)); + int x = sep; for (int i = 0, len = layout.size(); i < len; ++i) { otk::Rect *area; @@ -216,8 +224,6 @@ void OBFrame::update() continue; // just to fuck with g++ } area->setX(x); - if (layout[i] != 'L') - _label_area.setWidth(_label_area.width() - area->width()); x += sep + area->width(); } } @@ -386,25 +392,18 @@ void OBFrame::updateShape() void OBFrame::grabClient() { - XGrabServer(otk::OBDisplay::display); - // select the event mask on the frame - XSelectInput(otk::OBDisplay::display, _window, SubstructureRedirectMask); + //XSelectInput(otk::OBDisplay::display, _window, SubstructureRedirectMask); // reparent the client to the frame - XSelectInput(otk::OBDisplay::display, _client->window(), - OBClient::event_mask & ~StructureNotifyMask); XReparentWindow(otk::OBDisplay::display, _client->window(), _window, 0, 0); - XSelectInput(otk::OBDisplay::display, _client->window(), - OBClient::event_mask); + _client->ignore_unmaps++; // raise the client above the frame - XRaiseWindow(otk::OBDisplay::display, _client->window()); + //XRaiseWindow(otk::OBDisplay::display, _client->window()); // map the client so it maps when the frame does XMapWindow(otk::OBDisplay::display, _client->window()); - XUngrabServer(otk::OBDisplay::display); - update(); } @@ -448,7 +447,6 @@ Window OBFrame::createChild(Window parent, Cursor cursor) Window w = XCreateWindow(otk::OBDisplay::display, parent, 0, 0, 1, 1, 0, _screen->getDepth(), InputOutput, _screen->getVisual(), create_mask, &attrib_create); - XRaiseWindow(otk::OBDisplay::display, w); // raise above the parent return w; }