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

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

Re: [ELISP] Detect focus on emacs.


From: Joe Corneli
Subject: Re: [ELISP] Detect focus on emacs.
Date: Tue, 03 May 2005 22:46:14 -0500

   >>>   I need to know if emacs has the global input focus, that's to say,
   >>>   if emacs' window is the selected one in the wm.
   >>
   >> I don't think you can do that from elisp as of Emacs-22.
   >> Patches are welcome to add the functionality, of course,
   >
   >     Ok, why not !
   >
   >     A   function   like  `window-focus-p',   that   will  check   with
   >   XGetInputFocus(3x)/GetForegroundWindow(w32)  if  the current  window
   >   has the input focus ?
   >
   >     So I'll  have a try. BTW,  is there guidelines  for emacs patches,
   >   some must-know coding style or whatever like that somewhere ?
   >
   I think the problem you are having is because focus information is
   handled at the X and window manager level - I don't think emacs knows
   anything about the focus. Note that this is just a guess.

With the right window manager, it is certainly very easy to get access
to this information from within Emacs.  But I'd assume that there are
also some cross-WM methods... after all, all WMs know which window has
focus.  (Yes, this assumption involves a bit of a leap of faith on my
part.)




reply via email to

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