      (selected-window) 
      (get-buffer-create (format "*rdebug-breakpoints-%s*" script-name)))
     (other-window 1)
-    (goto-char (point-max)))))
+    (goto-char (point-max))
+    (rdebug-set-window-configuration-state 'debugger))))
   
 (defun rdebug-restore-windows ()
   "Equivalent of `gdb-restore-windows' for rdebug."

  (concat rdebug--stack-frame-1st-regexp rdebug--stack-frame-2nd-regexp)
  "Regexp to recognize a stack frame line in rdebug stack buffers.")

(defun rdebug--setup-stack-buffer (buf name)
  "Detects stack frame lines and sets up mouse navigation."
  (rdebug-debug-enter "rdebug--setup-stack-buffer"
  (with-current-buffer buf

  "Restore the original window configuration when the debugger process exits."
  (gud-sentinel process event)
  (rdebug-debug-enter "rdebug-process-sentinel"
    (rdebug-debug-message "status=%S event=%S state=%S"
                          (process-status process)
                          event
                          rdebug-window-configuration-state)
