later. Stay tuned.
Changelog for Openbox:
1.0.0:
+ * added a runtime option for hiding the toolbar. (Scott Moynes)
+
* made shaded windows edge-snap correctly to the
bottom for their size instead for their unshaded
size. (Ben Jansens)
# Top to Bottom
$ #BottomTop
# Bottom to Top
+$ #HideToolbar
+# Hide Toolbar
"Focus New Windows"), 4);
insert(i18n->getMessage(ConfigmenuSet, ConfigmenuFocusLast,
"Focus Last Window on Workspace"), 5);
+ insert(i18n->getMessage(ConfigmenuSet, ConfigmenuHideToolbar,
+ "Hide toolbar"), 6);
update();
setItemSelected(2, screen.getImageControl()->doDither());
setItemSelected(4, screen.doFullMax());
setItemSelected(5, screen.doFocusNew());
setItemSelected(6, screen.doFocusLast());
+ setItemSelected(7, screen.doToolbarHide());
}
Configmenu::~Configmenu(void) {
}
case 5: { // focus last window on workspace
- screen.saveFocusLast((! screen.doFocusLast()));
+ screen.saveFocusLast(!(screen.doFocusLast()));
setItemSelected(index, screen.doFocusLast());
break;
}
+ case 6:{ //toggle toolbar hide
+ screen.saveToolbarHide(!(screen.doToolbarHide()));
+ setItemSelected(index, screen.doToolbarHide());
+ break;
+ }
} // switch
}
setLabel(i18n->getMessage(ConfigmenuSet, ConfigmenuWindowPlacement,
"Window Placement"));
setInternalMenu();
-
+
insert(i18n->getMessage(ConfigmenuSet, ConfigmenuSmartRows,
"Smart Placement (Rows)"),
BScreen::RowSmartPlacement);
}
}
-
void BScreen::hideGeometry(void) {
if (geom_visible) {
XUnmapWindow(getBaseDisplay().getXDisplay(), geom_window);
geom_visible = False;
}
}
+
+void BScreen::saveToolbarHide(Bool b){
+ resource.toolbar_total_hide = b;
+ if (toolbar != NULL){
+ if (b)
+ toolbar->unMapToolbar();
+ else
+ toolbar->mapToolbar();
+ }
+
+}
Bool toolbar_on_top, toolbar_auto_hide, sloppy_focus, auto_raise,
auto_edge_balance, image_dither, ordered_dither, opaque_move, full_max,
- focus_new, focus_last;
+ focus_new, focus_last, toolbar_total_hide;
BColor border_color;
obResource styleconfig;
{ return resource.toolbar_on_top; }
inline const Bool &doToolbarAutoHide(void) const
{ return resource.toolbar_auto_hide; }
+ inline const Bool &doToolbarHide(void) const
+ {return resource.toolbar_total_hide;}
inline const Bool &isSloppyFocus(void) const
{ return resource.sloppy_focus; }
inline const Bool &isRootColormapInstalled(void) const
inline void saveFocusNew(Bool f) { resource.focus_new = f; }
inline void saveFocusLast(Bool f) { resource.focus_last = f; }
inline void iconUpdate(void) { iconmenu->update(); }
-
#ifdef HAVE_STRFTIME
inline char *getStrftimeFormat(void) { return resource.strftime_format; }
void saveStrftimeFormat(const char *);
void showPosition(int, int);
void showGeometry(unsigned int, unsigned int);
void hideGeometry(void);
-
+ void saveToolbarHide( Bool b);
void updateNetizenCurrentWorkspace(void);
void updateNetizenWorkspaceCount(void);
void updateNetizenWindowFocus(void);
#include <X11/keysym.h>
-#ifdef HAVE_STRING_H
+#ifdef STDC_HEADERS
# include <string.h>
-#endif // HAVE_STRING_H
+#endif // STDC_HEADERS
#ifdef HAVE_STDIO_H
# include <stdio.h>
frame.pbutton = None;
reconfigure();
-
- XMapSubwindows(display, frame.window);
- XMapWindow(display, frame.window);
+ mapToolbar();
}
-
-Toolbar::~Toolbar(void) {
+inline void Toolbar::mapToolbar(){
+ if(!screen.doToolbarHide()){
+ do_hide=false;//not hidden, so windows should not maximize over the toolbar
+ XMapSubwindows(display, frame.window);
+ XMapWindow(display, frame.window);
+ }else
+ do_hide=true;
+}
+inline void Toolbar::unMapToolbar(){
+ do_hide=true; //hidden so we can maximize over the toolbar
XUnmapWindow(display, frame.window);
+}
+Toolbar::~Toolbar(void) {
+ unMapToolbar();
if (frame.base) image_ctrl->removeImage(frame.base);
if (frame.label) image_ctrl->removeImage(frame.label);
if (frame.wlabel) image_ctrl->removeImage(frame.wlabel);
XClearWindow(display, frame.nsbutton);
XClearWindow(display, frame.pwbutton);
XClearWindow(display, frame.nwbutton);
-
+
redrawWindowLabel();
redrawWorkspaceLabel();
redrawPrevWorkspaceButton();
redrawPrevWindowButton();
redrawNextWindowButton();
checkClock(True);
-
+
toolbarmenu->reconfigure();
}
class Toolbar : public TimeoutHandler {
private:
- Bool on_top, editing, hidden, do_auto_hide;
+ Bool on_top, editing, hidden, do_auto_hide, do_hide;
Display *display;
struct frame {
inline const unsigned int &getWidth(void) const { return frame.width; }
inline const unsigned int &getHeight(void) const { return frame.height; }
- inline const unsigned int &getExposedHeight(void) const
- { return ((do_auto_hide) ? frame.bevel_w : frame.height); }
+ inline const unsigned int getExposedHeight(void) const {
+ if (do_hide) return 0;
+ else if (do_auto_hide) return frame.bevel_w;
+ else return frame.height;
+ }
+
inline const int &getX(void) const
{ return ((hidden) ? frame.x_hidden : frame.x); }
- inline const int &getY(void) const
- { return ((hidden) ? frame.y_hidden : frame.y); }
-
+ inline const int getY(void) const
+ { return ((hidden || do_hide) ? frame.y_hidden : frame.y); }
+
void buttonPressEvent(XButtonEvent *);
void buttonReleaseEvent(XButtonEvent *);
void enterNotifyEvent(XCrossingEvent *);
void redrawNextWindowButton(Bool = False, Bool = False);
void edit(void);
void reconfigure(void);
-
+ void mapToolbar(void);
+ void unMapToolbar(void);
#ifdef HAVE_STRFTIME
void checkClock(Bool = False);
#else // HAVE_STRFTIME
config.setValue(rc_string, screen->getToolbar()->doAutoHide() ?
"True" : "False");
+ sprintf(rc_string, "session.screen%d.toolbar.hide", screen_number);
+ config.setValue(rc_string, screen->doToolbarHide() ?
+ "True" : "False");
+
+
switch (screen->getToolbarPlacement()) {
case Toolbar::TopLeft: placement = "TopLeft"; break;
case Toolbar::BottomLeft: placement = "BottomLeft"; break;
else
screen->saveToolbarOnTop(False);
+ sprintf(name_lookup, "session.screen%d.toolbar.hide", screen_number);
+ sprintf(class_lookup, "Session.Screen%d.Toolbar.Hide", screen_number);
+ if (config.getValue(name_lookup, class_lookup, b))
+ screen->saveToolbarHide((Bool)b);
+ else
+ screen->saveToolbarHide(False);
+
sprintf(name_lookup, "session.screen%d.toolbar.autoHide", screen_number);
sprintf(class_lookup, "Session.Screen%d.Toolbar.autoHide", screen_number);
if (config.getValue(name_lookup, class_lookup, b))