diff options
| author | Dana Jansens <danakj@orodu.net> | 2002-05-14 19:28:34 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2002-05-14 19:28:34 +0000 |
| commit | 1b1efab489353734f0047f97fe5fef7f96d0ee68 (patch) | |
| tree | c5aef6771f1634f9fe0add5d8f07c71b9358be9d /src/Window.cc | |
| parent | f00ed578baacb73a36227fed1419e9d451ee7bb0 (diff) | |
compile with -Wall -W -pendantic when --enable-debug is set.
Diffstat (limited to 'src/Window.cc')
| -rw-r--r-- | src/Window.cc | 42 |
1 files changed, 18 insertions, 24 deletions
diff --git a/src/Window.cc b/src/Window.cc index fe13f4c1..0e5af867 100644 --- a/src/Window.cc +++ b/src/Window.cc @@ -721,7 +721,7 @@ void OpenboxWindow::createMaximizeButton(void) { } -void OpenboxWindow::positionButtons(Bool redecorate_label) { +void OpenboxWindow::positionButtons() { const char *format = openbox.getTitleBarLayout(); const unsigned int bw = frame.bevel_w + 1; const unsigned int by = frame.bevel_w + 1; @@ -785,23 +785,19 @@ void OpenboxWindow::positionButtons(Bool redecorate_label) { } } - if (!hasclose) { - openbox.removeWindowSearch(frame.close_button); - XDestroyWindow(display, frame.close_button); - frame.close_button = None; + if (!hasclose && frame.close_button) { + openbox.removeWindowSearch(frame.close_button); + XDestroyWindow(display, frame.close_button); } - if (!hasiconify) { - openbox.removeWindowSearch(frame.iconify_button); - XDestroyWindow(display, frame.iconify_button); - frame.iconify_button = None; + if (!hasiconify && frame.iconify_button) { + openbox.removeWindowSearch(frame.iconify_button); + XDestroyWindow(display, frame.iconify_button); } - if (!hasmaximize) { - openbox.removeWindowSearch(frame.maximize_button); - XDestroyWindow(display, frame.maximize_button); - frame.maximize_button = None; + if (!hasmaximize && frame.iconify_button) { + openbox.removeWindowSearch(frame.maximize_button); + XDestroyWindow(display, frame.maximize_button); } - if (redecorate_label) - decorateLabel(); + redrawLabel(); redrawAllButtons(); } @@ -1302,10 +1298,9 @@ void OpenboxWindow::configure(int dx, int dy, XMoveWindow(display, frame.window, frame.x, frame.y); + setFocusFlag(flags.focused); positionWindows(); decorate(); - setFocusFlag(flags.focused); - redrawAllButtons(); } else { frame.x = dx; frame.y = dy; @@ -1534,7 +1529,7 @@ void OpenboxWindow::maximize(unsigned int button) { openbox_attrib.premax_x = openbox_attrib.premax_y = 0; openbox_attrib.premax_w = openbox_attrib.premax_h = 0; - redrawAllButtons(); + redrawMaximizeButton(flags.maximized); setState(current_state); return; } @@ -1608,7 +1603,7 @@ void OpenboxWindow::maximize(unsigned int button) { configure(dx, dy, dw, dh); screen->getWorkspace(workspace_number)->raiseWindow(this); - redrawAllButtons(); + redrawMaximizeButton(flags.maximized); setState(current_state); } @@ -2241,12 +2236,8 @@ void OpenboxWindow::mapNotifyEvent(XMapEvent *ne) { openbox.grab(); if (! validateClient()) return; - if (decorations.titlebar) positionButtons(); - setState(NormalState); - redrawAllButtons(); - if (flags.transient || screen->focusNew()) setInputFocus(); else @@ -2410,7 +2401,10 @@ void OpenboxWindow::propertyNotifyEvent(Atom atom) { if (decorations.close && (! frame.close_button)) { createCloseButton(); - if (decorations.titlebar) positionButtons(True); + if (decorations.titlebar) { + positionButtons(); + decorateLabel(); + } if (windowmenu) windowmenu->reconfigure(); } } |
