X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2FToolbar.cc;h=8a3ea6b2828acea09a5d0cbd2394fcc9a9e01513;hb=f75083669f65aadd6b32f8ed25880ca362296a2f;hp=fd2191445da5f34b08fa59107f91f6394f301eb8;hpb=ebdf25bf6710c9cf585489302dcd8ca23b9b226a;p=chaz%2Fopenbox diff --git a/src/Toolbar.cc b/src/Toolbar.cc index fd219144..8a3ea6b2 100644 --- a/src/Toolbar.cc +++ b/src/Toolbar.cc @@ -66,8 +66,8 @@ #include 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(); @@ -725,7 +725,9 @@ void Toolbar::checkClock(Bool redraw, Bool date) { 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); @@ -780,8 +782,6 @@ void Toolbar::redrawWindowLabel(Bool redraw) { else XDrawString(display, frame.window_label, style->w_text_gc, dx, (style->font->ascent + 1), *foc->getTitle(), dlen); - } else { - XClearWindow(display, frame.window_label); } } @@ -1154,9 +1154,9 @@ void Toolbar::keyPressEvent(XKeyEvent *ke) { 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.