In emacs, if I have two frames open and the mouse is positioned over the other frame (i.e. not over the active one), pressing the Alt key produces a <switch-frame> event.

While this event does nothing in itself, it disrupts things like yank-pop, which no longer works if it is bound to M-y as usual (because instead of the command sequence yank -> yank-pop, we now have yank -> handle-switch-frame -> yank-pop, which gives an error "user-error: Previous command was not a yank").

I don't know enough about X-Windows to know if this is emacs' fault or x-windows fault. But it's very annoying. What can I do about this?

[Tried on Emacs versions 24.5, 25.1, and the 26.0 and Ubuntu 16.10.
I initially posted this on the emacs stack exchange but received no responses except a suggestion to post it here.]


1 Answer 1


This issue is that Unity is adding signals to the alt key. The ostensible reason is to make it so that Unity can hide the menu and then reshow it with the Alt key. So there is a two step process to fix this:

  1. In Settings | Appearance | Behavior, change "Menus visibility" to "Always displayed".

  2. Disable Unity intercepting the key:

    $ dconf write /org/compiz/profiles/unity/plugins/unityshell/show-menu-bar "'Disabled'"

[As an aside, I worked a bit on trying to solve this properly but I never got a response from the Unity team and I don't have enough time.]

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .