screen->addStrut(&strut);
reconfigure();
-
- XMapSubwindows(display, frame.window);
- XMapWindow(display, frame.window);
+ mapToolbar();
}
Toolbar::~Toolbar(void) {
- XUnmapWindow(display, frame.window);
+ unmapToolbar();
if (frame.base) screen->getImageControl()->removeImage(frame.base);
if (frame.label) screen->getImageControl()->removeImage(frame.label);
}
+void Toolbar::mapToolbar() {
+ if (!screen->doHideToolbar()) {
+ //not hidden, so windows should not maximize over the toolbar
+ XMapSubwindows(display, frame.window);
+ XMapWindow(display, frame.window);
+ }
+ updateStrut();
+}
+
+
+void Toolbar::unmapToolbar() {
+ if (toolbarmenu->isVisible())
+ toolbarmenu->hide();
+ //hidden so we can maximize over the toolbar
+ XUnmapWindow(display, frame.window);
+ updateStrut();
+}
+
+
void Toolbar::saveOnTop(bool b) {
on_top = b;
config->setValue(toolbarstr + "onTop", on_top);
// left and right are always 0
strut.top = strut.bottom = 0;
- switch(placement) {
- case TopLeft:
- case TopCenter:
- case TopRight:
- strut.top = getExposedHeight() + (screen->getBorderWidth() * 2);
- break;
- default:
- strut.bottom = getExposedHeight() + (screen->getBorderWidth() * 2);
+ // when hidden only one border is visible
+ unsigned int border_width = screen->getBorderWidth();
+ if (! do_auto_hide)
+ border_width *= 2;
+
+ if (! screen->doHideToolbar()) {
+ switch(placement) {
+ case TopLeft:
+ case TopCenter:
+ case TopRight:
+ strut.top = getExposedHeight() + border_width;
+ break;
+ default:
+ strut.bottom = getExposedHeight() + border_width;
+ }
}
screen->updateAvailableArea();