#include <string>
using std::ends;
-Toolbar::Toolbar(BScreen &scrn, Resource &conf) : screen(scrn),
- openbox(scrn.getOpenbox()), config(conf)
+Toolbar::Toolbar(BScreen &scrn, Resource &conf) : openbox(scrn.getOpenbox()),
+ screen(scrn), config(conf)
{
load();
void Toolbar::redrawWindowLabel(Bool redraw) {
OpenboxWindow *foc = screen.getOpenbox().focusedWindow();
- if (foc != (OpenboxWindow *) 0) {
+ if (foc == (OpenboxWindow *) 0) {
+ XClearWindow(display, frame.window_label);
+ } else {
if (redraw)
XClearWindow(display, frame.window_label);
else
XDrawString(display, frame.window_label, style->w_text_gc, dx,
(style->font->ascent + 1), *foc->getTitle(), dlen);
- } else {
- XClearWindow(display, frame.window_label);
}
}
if (openbox.focusedWindow()) {
openbox.focusedWindow()->setInputFocus();
openbox.focusedWindow()->setFocusFlag(True);
- } else {
- XSetInputFocus(display, PointerRoot, None, CurrentTime);
- }
+ } else
+ openbox.focusWindow((OpenboxWindow *) 0);
+
// check to make sure that new_name[0] != 0... otherwise we have a null
// workspace name which causes serious problems, especially for the
// Openbox::LoadRC() method.