From a shell in a GUI with sloppy focus (assuming that they are all similar, I am using GNOME here) do emacs -Q M-x set-variable RET focus-follows-mouse RET t RET C-x C-f /tmp/testfile RET C-x 5 2 and arrange frames side-by-side M-! touch /tmp/testfile RET Now move with the mouse from one frame to the other and immediately press a key. I get a message like