To control this behavior, there is a switch-to-visible-buffer variable. From the GNU Emacs 24.2 documentation:
switch-to-visible-buffer is a variable defined in `window.el'. Its value is t Documentation: If non-nil, allow switching to an already visible buffer. If this variable is non-nil, `switch-to-prev-buffer' and `switch-to-next-buffer' may switch to an already visible buffer provided the buffer was shown in the argument window before. If this variable is nil, `switch-to-prev-buffer' and `switch-to-next-buffer' always try to avoid switching to a buffer that is already visible in another window on the same frame. You can customize this variable. This variable was introduced, or its default value was changed, in version 24.1 of Emacs.
If this does not work, as it should work, there is probably an error.
source share