let the user remove client decorations.
This commit is contained in:
parent
6236b523e8
commit
98f05a5c96
2 changed files with 16 additions and 9 deletions
|
@ -51,6 +51,8 @@ Client::Client(int screen, Window window)
|
||||||
_urgent = false;
|
_urgent = false;
|
||||||
// not positioned unless specified
|
// not positioned unless specified
|
||||||
_positioned = false;
|
_positioned = false;
|
||||||
|
// nothing is disabled unless specified
|
||||||
|
_disabled_decorations = 0;
|
||||||
|
|
||||||
getArea();
|
getArea();
|
||||||
getDesktop();
|
getDesktop();
|
||||||
|
@ -306,6 +308,12 @@ void Client::setupDecorAndFunctions()
|
||||||
_decorations &= ~Decor_Close;
|
_decorations &= ~Decor_Close;
|
||||||
|
|
||||||
changeAllowedActions();
|
changeAllowedActions();
|
||||||
|
|
||||||
|
if (frame) {
|
||||||
|
frame->adjustSize(); // change the decors on the frame
|
||||||
|
frame->adjustPosition(); // with more/less decorations, we may need to be
|
||||||
|
// moved
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -625,6 +633,9 @@ void Client::updateStrut()
|
||||||
_strut.top = data[2];
|
_strut.top = data[2];
|
||||||
_strut.bottom = data[3];
|
_strut.bottom = data[3];
|
||||||
|
|
||||||
|
// updating here is pointless while we're being mapped cuz we're not in
|
||||||
|
// the screen's client list yet
|
||||||
|
if (frame)
|
||||||
openbox->screen(_screen)->updateStrut();
|
openbox->screen(_screen)->updateStrut();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -695,7 +706,6 @@ void Client::propertyHandler(const XPropertyEvent &e)
|
||||||
getType();
|
getType();
|
||||||
calcLayer(); // type may have changed, so update the layer
|
calcLayer(); // type may have changed, so update the layer
|
||||||
setupDecorAndFunctions();
|
setupDecorAndFunctions();
|
||||||
frame->adjustSize(); // this updates the frame for any new decor settings
|
|
||||||
}
|
}
|
||||||
else if (e.atom == otk::Property::atoms.net_wm_name ||
|
else if (e.atom == otk::Property::atoms.net_wm_name ||
|
||||||
e.atom == otk::Property::atoms.wm_name)
|
e.atom == otk::Property::atoms.wm_name)
|
||||||
|
@ -708,7 +718,6 @@ void Client::propertyHandler(const XPropertyEvent &e)
|
||||||
else if (e.atom == otk::Property::atoms.wm_protocols) {
|
else if (e.atom == otk::Property::atoms.wm_protocols) {
|
||||||
updateProtocols();
|
updateProtocols();
|
||||||
setupDecorAndFunctions();
|
setupDecorAndFunctions();
|
||||||
frame->adjustSize(); // update the decorations
|
|
||||||
}
|
}
|
||||||
else if (e.atom == otk::Property::atoms.net_wm_strut)
|
else if (e.atom == otk::Property::atoms.net_wm_strut)
|
||||||
updateStrut();
|
updateStrut();
|
||||||
|
@ -1343,8 +1352,6 @@ void Client::disableDecorations(DecorationFlags flags)
|
||||||
{
|
{
|
||||||
_disabled_decorations = flags;
|
_disabled_decorations = flags;
|
||||||
setupDecorAndFunctions();
|
setupDecorAndFunctions();
|
||||||
if (frame)
|
|
||||||
frame->adjustSize(); // change the decors on the frame
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -128,7 +128,8 @@ void Frame::adjustSize()
|
||||||
int width; // the width of the client and its border
|
int width; // the width of the client and its border
|
||||||
int bwidth; // width to make borders
|
int bwidth; // width to make borders
|
||||||
int cbwidth; // width of the inner client border
|
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();
|
const int bevel = _style->bevelWidth();
|
||||||
|
|
||||||
if (_decorations & Client::Decor_Border) {
|
if (_decorations & Client::Decor_Border) {
|
||||||
|
@ -157,9 +158,8 @@ void Frame::adjustSize()
|
||||||
_innersize.top += _titlebar.height() + bwidth;
|
_innersize.top += _titlebar.height() + bwidth;
|
||||||
|
|
||||||
// set the label size
|
// set the label size
|
||||||
_label.setGeometry(0, bevel, width, _style->labelFont()->height());
|
_label.setGeometry(0, bevel, width, fontheight);
|
||||||
// set the buttons sizes
|
// set the buttons sizes
|
||||||
butsize = _label.height() - 2;
|
|
||||||
if (_decorations & Client::Decor_Iconify)
|
if (_decorations & Client::Decor_Iconify)
|
||||||
_button_iconify.setGeometry(0, bevel + 1, butsize, butsize);
|
_button_iconify.setGeometry(0, bevel + 1, butsize, butsize);
|
||||||
if (_decorations & Client::Decor_Maximize)
|
if (_decorations & Client::Decor_Maximize)
|
||||||
|
|
Loading…
Reference in a new issue