help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to determine (from Elisp) whether the Emacs frame has focus?


From: Eli Zaretskii
Subject: Re: How to determine (from Elisp) whether the Emacs frame has focus?
Date: Sat, 14 Nov 2015 10:59:13 +0200

> From: Marcin Borkowski <mbork@mbork.pl>
> Cc: help-gnu-emacs@gnu.org
> Date: Sat, 14 Nov 2015 09:42:09 +0100
> 
> >> I'd like to know whether the selected Emacs frame has focus.
> >
> > I'm probably missing something very important, because I don't
> > understand what you are looking for.  The selected frame by definition
> > has focus, at least AFAIK.  What am I missing?
> 
> "Focus" in the window manager sense, not in Emacs sense.  I.e., I want
> to determine whether it is Emacs which receives keystrokes, or some
> other X application.
> 
> Hope that clarifies the question.

Not really, sorry.  The function selected-frame returns the frame that
receives keystrokes, at least as far as I understand what you are
saying.  The ELisp manual explicitly says:

   -- Function: selected-frame
       This function returns the selected frame.

     Some window systems and window managers direct keyboard input to the
  window object that the mouse is in; others require explicit clicks or
  commands to "shift the focus" to various window objects.  Either way,
  Emacs automatically keeps track of which frame has the focus.

Perhaps you are talking about some very specialized situation or need,
in which case please describe in more details why the call to
selected-frame and comparison with the frame you want to test is not
what you need.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]