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: John Mastro
Subject: Re: How to determine (from Elisp) whether the Emacs frame has focus?
Date: Fri, 13 Nov 2015 20:05:11 -0800

Marcin Borkowski <mbork@mbork.pl> wrote:
> I'd like to know whether the selected Emacs frame has focus.  Currently,
> I'm using an xdotool/xprop combo (I'm on GNU/Linux), but I'd like to
> know whether there is a better way.  I know about focus-in-hook and
> focus-out-hook, and I could make them set/unset some global variable,
> but this looks hackish.

Not that I can tell.

I'm not sure if it would end up less hackish, but an alternative to
global variables might be to use frame parameters. See the info nodes
"(Elisp) Frame Parameters" and "(Elisp) Parameter Access".

-- 
john



reply via email to

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