This question is related to this...
In this case I wonder how could I switch to the previous X window when working in a given workspace of EXWM (by X window I refer to a top-level X window created by an application).
The situations is as follows: Say I am reading a website in a Chromium window. Then I
C-x b to an Emacs buffer. Then if I
C-x b C-o I will get to the next X window in the cycle instead of the Chromium window I was originally reading. Currently I have to
C-g and then
C-x b C-o again to get back to the original Chromium window I was reading at the start of the process.
Because it is often nice to move back and forth between reading something on the web and doing something else in an Emacs buffer, I think it would be nice to have a function that allows doing this back and forth movement, but my poor Lisp prevents me from implementing it.
To put my query otherwise, what I'm looking for is something similar Ambrevar's solution for buffers as follows
(defun ambrevar/switch-to-last-buffer ()
"Switch to last open buffer in current window."
(switch-to-buffer (other-buffer (current-buffer) 1)))
... applied to EXWM X windows only.