How to focus on the new Emacs frame on Windows

How to get focus for a new Emacs frame when it was raised from outside Emacs (e.g. from emacsclient or edit-server )? Currently, the new frame receives input focus, but does not display focus, i.e. You enter text, but it is located somewhere behind other windows (in Windows terminology). There was a similar question , and it was marked as an answer, but without a solution.

Emacs 23.3.

+4
source share
3 answers

The raise-frame function can bring the frame to the fore.

+2
source

What version of Emacs are you using? I used put in gnuserv-visit-hook:

 (select-frame-set-input-focus (window-frame (selected-window))) 

But with Emacs 23 it is by default controlled by server-raise-frame .

+1
source

See also the select-frame-set-input-focus function:

"Select FRAME, raise it and set the input focus, if possible."

-1
source

All Articles