unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Michael Cadilhac <Michael.Cadilhac-@t-lrde.epita.fr>
Subject: Re: [ELISP] Detect focus on emacs.
Date: Wed, 04 May 2005 22:13:46 +0200	[thread overview]
Message-ID: <87sm12iwat.fsf@mahaena.lrde> (raw)
In-Reply-To: 87is20zo0v.fsf@tiger.rapttech.com.au


[-- Attachment #1.1.1: Type: text/plain, Size: 1106 bytes --]

Tim X <timx@spamto.devnul.com> writes:

> Michael Cadilhac <Michael.Cadilhac@lrde.epita.fr> writes:
>
>> Stefan Monnier <monnier@iro.umontreal.ca> writes:
>>
>>>>   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.

  It seems that my answer is now a bunch of lost bytes in the cruel
  world of usenet.

  God bless the mighty sent messages saving in gnus.


[-- Attachment #1.1.2: Type: message/rfc822, Size: 2102 bytes --]

From: Michael Cadilhac <Michael.Cadilhac.@t.lrde.epita.fr>
To: help-gnu-emacs@gnu.org
Subject: Re: [ELISP] Detect focus on emacs.
Date: Wed, 04 May 2005 12:00:27 +0200
Message-ID: <8764xzxqdg.fsf@mahaena.lrde>

Tim X <timx@spamto.devnul.com> writes:

> Michael Cadilhac <Michael.Cadilhac@lrde.epita.fr> writes:
>
>> Stefan Monnier <monnier@iro.umontreal.ca> writes:
>>
>>>>   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.

  Yep, I  think the problem  is here. But  now the question is,  is it
worth doing a `frame-focus-p' compatible with X and W32 (and more ?)?

  As said, It'll be a great  thing for modules wanting to do something
iif the user is not concentrated on emacs.

  I'm wondering if this patch has to be more than X/W32 compatible; In
fact, I don't know if mac's cocoa is managed in the same way.

[-- Attachment #1.1.3: Type: text/plain, Size: 431 bytes --]




  By the  way, the proposal  of rgb provides  a nicer way to  use this
functionality, but I'm not sure  this is really possible to have focus
hooks on a w32 system, isn't it ?


-- 
    Michael Cadilhac, a.k.a. Micha [mika] |
                    Epita/LRDE promo 2007 |  Please note that you should
  2 rue de la Convention | 01.46.70.90.75 |  s/-@t-/@/ my mail address.
94270 Le Kremlin Bicetre | 06.23.20.31.30 |

[-- Attachment #1.2: Type: application/pgp-signature, Size: 188 bytes --]

[-- Attachment #2: Type: text/plain, Size: 152 bytes --]

_______________________________________________
Help-gnu-emacs mailing list
Help-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs

  parent reply	other threads:[~2005-05-04 20:13 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
2005-05-04 15:56       ` Kevin Rodgers
2005-05-04 20:13       ` Michael Cadilhac [this message]
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=87sm12iwat.fsf@mahaena.lrde \
    --to=michael.cadilhac-@t-lrde.epita.fr \
    /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).