unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Joe Corneli <jcorneli@math.utexas.edu>
Subject: Re: [ELISP] Detect focus on emacs.
Date: Tue, 03 May 2005 22:46:14 -0500	[thread overview]
Message-ID: <E1DTApy-0004BL-00@lab1.ma.utexas.edu> (raw)
In-Reply-To: <87is20zo0v.fsf@tiger.rapttech.com.au> (message from Tim X on Tue, 03 May 2005 18:56:00 +1000)


   >>>   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	other threads:[~2005-05-04  3:46 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-25 22:47 [ELISP] Detect focus on emacs Micha
2005-04-27 10:10 ` Micha
2005-04-27 12:10   ` Peter Dyballa
     [not found]   ` <mailman.3175.1114604433.2895.help-gnu-emacs@gnu.org>
2005-04-27 17:41     ` Mathias Dahl
2005-04-27 19:08       ` Micha
2005-05-02 13:50         ` rgb
2005-05-03 13:15           ` Mathias Dahl
2005-05-03 16:57             ` rgb
2005-05-02  0:38 ` [ELISP] " Stefan Monnier
2005-05-02 21:21   ` Michael Cadilhac
2005-05-03  3:09     ` Joe Corneli
2005-05-03 19:33       ` Peter Dyballa
2005-05-04 20:29         ` Drew Adams
2005-05-04 21:15           ` Peter Dyballa
2005-05-04 21:31             ` Drew Adams
2005-05-04 22:28               ` Peter Dyballa
     [not found]           ` <mailman.3325.1115241750.2819.help-gnu-emacs@gnu.org>
2005-05-04 21:44             ` Michael Cadilhac
     [not found]       ` <mailman.3162.1115148898.2819.help-gnu-emacs@gnu.org>
2005-05-04 19:57         ` Michael Cadilhac
2005-05-04 20:03           ` Michael Cadilhac
2005-05-05  2:53           ` Joe Corneli
     [not found]           ` <mailman.3390.1115261851.2819.help-gnu-emacs@gnu.org>
2005-05-05  5:30             ` David Kastrup
     [not found]   ` <mailman.1224.1115069322.2819.help-gnu-emacs@gnu.org>
2005-05-03  8:56     ` Tim X
2005-05-04  3:46       ` Joe Corneli [this message]
2005-05-04 15:56       ` Kevin Rodgers
2005-05-04 20:13       ` Michael Cadilhac
2005-05-03 23:24     ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1DTApy-0004BL-00@lab1.ma.utexas.edu \
    --to=jcorneli@math.utexas.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).