X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2Fframe.cc;h=57b338c8905743d279fd3579657d3f6359e279d6;hb=9e6b0d5a8d0226232802bdece77665b167f98dae;hp=956e853c65a824fe3f9d003987a68217df0461b0;hpb=28b8f67562bb7eb15134f2bf7a8394f0a009b9ba;p=chaz%2Fopenbox diff --git a/src/frame.cc b/src/frame.cc index 956e853c..57b338c8 100644 --- a/src/frame.cc +++ b/src/frame.cc @@ -128,7 +128,8 @@ void Frame::adjustSize() int width; // the width of the client and its border int bwidth; // width to make borders int cbwidth; // width of the inner client border - int butsize=0; // width and height of the titlebar buttons + int fontheight = _style->labelFont()->height(); // height of the font + int butsize = fontheight - 2; // width and height of the titlebar buttons const int bevel = _style->bevelWidth(); if (_decorations & Client::Decor_Border) { @@ -157,9 +158,8 @@ void Frame::adjustSize() _innersize.top += _titlebar.height() + bwidth; // set the label size - _label.setGeometry(0, bevel, width, _style->labelFont()->height()); + _label.setGeometry(0, bevel, width, fontheight); // set the buttons sizes - butsize = _label.height() - 2; if (_decorations & Client::Decor_Iconify) _button_iconify.setGeometry(0, bevel + 1, butsize, butsize); if (_decorations & Client::Decor_Maximize) @@ -173,7 +173,7 @@ void Frame::adjustSize() const int sep = bevel + 1; otk::ustring layout; - if (!python_get_string("titlebar_layout", &layout)) + if (!python_get_string("TITLEBAR_LAYOUT", &layout)) layout = "ILMC"; // this code ensures that the string only has one of each possible @@ -344,6 +344,8 @@ void Frame::adjustSize() void Frame::adjustPosition() { int x, y; + x = _client->area().x(); + y = _client->area().y(); clientGravity(x, y); move(x, y); } @@ -405,8 +407,7 @@ void Frame::adjustState() void Frame::grabClient() { // reparent the client to the frame - XReparentWindow(**otk::display, _client->window(), - _plate.window(), 0, 0); + XReparentWindow(**otk::display, _client->window(), _plate.window(), 0, 0); /* When reparenting the client window, it is usually not mapped yet, since this occurs from a MapRequest. However, in the case where Openbox is @@ -418,9 +419,8 @@ void Frame::grabClient() if (openbox->state() == Openbox::State_Starting) _client->ignore_unmaps += 2; - // select the event mask on the client's parent (to receive config req's) - XSelectInput(**otk::display, _plate.window(), - SubstructureRedirectMask); + // select the event mask on the client's parent (to receive config/map req's) + XSelectInput(**otk::display, _plate.window(), SubstructureRedirectMask); // map the client so it maps when the frame does XMapWindow(**otk::display, _client->window()); @@ -452,9 +452,6 @@ void Frame::releaseClient() void Frame::clientGravity(int &x, int &y) { - x = _client->area().x(); - y = _client->area().y(); - // horizontal switch (_client->gravity()) { default: @@ -511,9 +508,6 @@ void Frame::clientGravity(int &x, int &y) void Frame::frameGravity(int &x, int &y) { - x = rect().x(); - y = rect().y(); - // horizontal switch (_client->gravity()) { default: