]> Dogcows Code - chaz/openbox/blobdiff - src/Toolbar.cc
*** empty log message ***
[chaz/openbox] / src / Toolbar.cc
index fd2191445da5f34b08fa59107f91f6394f301eb8..8a3ea6b2828acea09a5d0cbd2394fcc9a9e01513 100644 (file)
@@ -66,8 +66,8 @@
 #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();
 
@@ -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.
This page took 0.021489 seconds and 4 git commands to generate.