I am running emacs on a Linux machine to my Windows 10 desktop server (running VcXsrv I'd like to get a hollow-square cursor when the emacs window doesn't have keyboard focus, and a filled-square cursor when it does.

I am running the solarized-dark theme in case that makes a difference.

Can someone please lend me a clue?

  • 2
    Emacs does this out of the box with zero user-configuration. If your Emacs does something else, then you will need to find out where that occurs in your user-configuration. Look for the variables cursor-type and cursor-in-non-selected-windows. – lawlist Apr 14 at 22:48

Debugging pointed away from emacs and to my X-Server. In case anyone else has this issue, my problem is that when I lose keyboard focus by clicking on a Windows-10 window, the emacs focus-out-hook is not being called (presumably because the xserver is not posting the defocus event). When I lose keyboard focus by clicking on another X window, the cursor goes hollow as it should. (If I lose focus by clicking on a Windows-10 window and then click on a different X window, the focus-out event happens when I focus on the X window).

The emacs focus-out-hook is called when focus shifts to the other X window. It is not called on shifting to a Windows-10 window.

  • 1
    I thought you wanted hollow box and filled box. You might want to modify your answer or your question so they correspond. – Drew Apr 15 at 14:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.