[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ELISP] Detect focus on emacs.
From: |
Michael Cadilhac |
Subject: |
Re: [ELISP] Detect focus on emacs. |
Date: |
Wed, 04 May 2005 22:13:46 +0200 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) |
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.
--- Begin Message ---
Subject: |
Re: [ELISP] Detect focus on emacs. |
Date: |
Wed, 04 May 2005 12:00:27 +0200 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) |
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.
--- End Message ---
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 |
pgp7l9zKtbMRI.pgp
Description: PGP signature
- RE: [ELISP] Detect focus on emacs., (continued)
- Message not available
- Re: [ELISP] Detect focus on emacs., Michael Cadilhac, 2005/05/04
- Message not available
- Re: [ELISP] Detect focus on emacs., Michael Cadilhac, 2005/05/04
- Re: [ELISP] Detect focus on emacs., Michael Cadilhac, 2005/05/04
- Re: [ELISP] Detect focus on emacs., Joe Corneli, 2005/05/04
- Message not available
- Re: [ELISP] Detect focus on emacs., David Kastrup, 2005/05/05
Message not available
Message not available