blackbox_attrib.workspace = window_number = BSENTINEL;
- blackbox_attrib.flags = blackbox_attrib.attrib = blackbox_attrib.stack
- = blackbox_attrib.decoration = 0l;
+ blackbox_attrib.flags = blackbox_attrib.attrib = blackbox_attrib.stack = 0l;
+ blackbox_attrib.decoration = DecorNormal;
blackbox_attrib.premax_x = blackbox_attrib.premax_y = 0;
blackbox_attrib.premax_w = blackbox_attrib.premax_h = 0;
// get size, aspect, minimum/maximum size and other hints set by the
// client
- if (! getBlackboxHints()) {
+ if (! getBlackboxHints())
getNetWMHints();
- }
getWMProtocols();
getWMHints();
setAllowedActions();
- enableDecor(True);
+ setupDecor();
if (decorations & Decor_Titlebar)
createTitlebar();
void BlackboxWindow::enableDecor(bool enable) {
- if (enable) {
+ blackbox_attrib.flags |= AttribDecoration;
+ blackbox_attrib.decoration = enable ? DecorNormal : DecorNone;
+ setupDecor();
+
+ // we can not be shaded if we lack a titlebar
+ if (! (decorations & Decor_Titlebar) && flags.shaded)
+ shade();
+
+ if (flags.visible && frame.window) {
+ XMapSubwindows(blackbox->getXDisplay(), frame.window);
+ XMapWindow(blackbox->getXDisplay(), frame.window);
+ }
+
+ reconfigure();
+ setState(current_state);
+}
+
+
+void BlackboxWindow::setupDecor() {
+ if (blackbox_attrib.decoration != DecorNone) {
// start with everything on
decorations =
(mwm_decorations & Decor_Titlebar ? Decor_Titlebar : 0) |
if (decorations & Decor_Border) {
frame.fborder_pixel = screen->getWindowStyle()->f_focus.pixel();
frame.uborder_pixel = screen->getWindowStyle()->f_unfocus.pixel();
- blackbox_attrib.flags |= AttribDecoration;
- blackbox_attrib.decoration = DecorNormal;
- } else {
- blackbox_attrib.flags |= AttribDecoration;
- blackbox_attrib.decoration = DecorNone;
}
if (decorations & Decor_Handle) {
if (blackbox_hint->flags & AttribDecoration) {
switch (blackbox_hint->decoration) {
case DecorNone:
- enableDecor(False);
+ blackbox_attrib.decoration = DecorNone;
break;
case DecorTiny:
case DecorTool:
case DecorNormal:
default:
- enableDecor(True);
+ // blackbox_attrib.decoration defaults to DecorNormal
break;
}
-
- reconfigure();
}
delete [] blackbox_hint;
enableDecor(True);
break;
}
-
- // we can not be shaded if we lack a titlebar
- if (! (decorations & Decor_Titlebar) && flags.shaded)
- shade();
-
- if (flags.visible && frame.window) {
- XMapSubwindows(blackbox->getXDisplay(), frame.window);
- XMapWindow(blackbox->getXDisplay(), frame.window);
- }
-
- reconfigure();
- setState(current_state);
}
// with the state set it will then be the map event's job to read the
if (isTransient()) {
functions &= ~Func_Maximize;
setAllowedActions();
- enableDecor(True);
+ setupDecor();
}
reconfigure();
}
grabButtons();
setAllowedActions();
- enableDecor(True);
+ setupDecor();
}
Rect old_rect = frame.rect;
enableDecor(True);
break;
}
-
- // we can not be shaded if we lack a titlebar
- if (flags.shaded && ! (decorations & Decor_Titlebar))
- shade();
-
- if (flags.visible && frame.window) {
- XMapSubwindows(blackbox->getXDisplay(), frame.window);
- XMapWindow(blackbox->getXDisplay(), frame.window);
- }
-
- reconfigure();
- setState(current_state);
}
}
/*
* what decorations do we have?
* this is based on the type of the client window as well as user input
- * the menu is not really decor, but it goes hand in hand with the decor
*/
DecorationFlags decorations;
DecorationFlags mwm_decorations;
void beginMove(int x_root, int y_root);
void beginResize(int x_root, int y_root, Corner dir);
void enableDecor(bool enable);
+ void setupDecor();
void setFocusFlag(bool focus);
void iconify(void);
void deiconify(bool reassoc = True, bool raise = True);