Index: src/Screen.cc
===================================================================
RCS file: /cvsroot/blackboxwm/blackbox/src/Screen.cc,v
retrieving revision 1.69
diff -u -r1.69 Screen.cc
--- src/Screen.cc	27 May 2002 08:52:41 -0000	1.69
+++ src/Screen.cc	31 May 2002 05:31:18 -0000
@@ -789,7 +789,7 @@
 
     if (blackbox->getFocusedWindow() &&
         blackbox->getFocusedWindow()->getScreen() == this &&
-        (! blackbox->getFocusedWindow()->isStuck())) {
+        ! blackbox->getFocusedWindow()->isStuck()) {
       current_workspace->setLastFocusedWindow(blackbox->getFocusedWindow());
       blackbox->setFocusedWindow((BlackboxWindow *) 0);
     }
@@ -803,6 +803,8 @@
 
     if (resource.focus_last && current_workspace->getLastFocusedWindow()) {
       XSync(blackbox->getXDisplay(), False);
+      BlackboxWindow *window = current_workspace->getLastFocusedWindow();
+      fprintf(stderr, "giving focus to %s", window->getTitle());
       current_workspace->getLastFocusedWindow()->setInputFocus();
     }
   }
Index: src/Window.cc
===================================================================
RCS file: /cvsroot/blackboxwm/blackbox/src/Window.cc,v
retrieving revision 1.104
diff -u -r1.104 Window.cc
--- src/Window.cc	30 May 2002 23:17:57 -0000	1.104
+++ src/Window.cc	31 May 2002 05:31:21 -0000
@@ -1274,6 +1274,7 @@
 
 
 bool BlackboxWindow::setInputFocus(void) {
+  fprintf(stderr, "setInputFocus: focusing %s\n", getTitle());
   if (flags.focused) return True;
 
   if (! client.rect.intersects(screen->getRect())) {
@@ -1285,6 +1286,7 @@
 
   if (client.transientList.size() > 0) {
     // transfer focus to any modal transients
+    fprintf(stderr, "setInputyFocus: looking for a modal transient\n");
     BlackboxWindowList::iterator it, end = client.transientList.end();
     for (it = client.transientList.begin(); it != end; ++it) {
       if ((*it)->flags.modal) return (*it)->setInputFocus();
@@ -1305,6 +1307,7 @@
     ret = False;
   }
 
+  fprintf(stderr, "setInputFocus: %s now has focus\n", getTitle());
   if (flags.send_focus_message) {
     XEvent ce;
     ce.xclient.type = ClientMessage;
