* Getting notified on focus events.
@ 2006-10-25 16:54 martin.blais
2006-10-25 18:16 ` rgb
0 siblings, 1 reply; 2+ messages in thread
From: martin.blais @ 2006-10-25 16:54 UTC (permalink / raw)
Hi
New gig, new environment, and I inherited two glorious 30-inch LCD
monitors and a 24-in sidekick. Nice setup one would think, but my
emacs windows are so unscrupulously large now that it takes me about 10
seconds to find where my cursor is, even with blinking on. To
alleviate the problem, I wrote an Emacs package that will briefly flash
an overlay around the cursor when I switch frames.
http://furius.ca/pubcode/pub/conf/common/elisp/blais/highwin.el
While this is working well when switching between frames, I also need
to flash my cursor when I switch between window manager windows (e.g.
non-Emacs windows, the X-windows of other applications). That is, I
need to be notified for enter-focus and leave-focus X events, somehow.
I tried adding an advice on handle-switch-frame and make-frame-visible
and a few other functions, and I cannot get it to work. There are no
hooks I could find.
Any idea? Can this be done?
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Getting notified on focus events.
2006-10-25 16:54 Getting notified on focus events martin.blais
@ 2006-10-25 18:16 ` rgb
0 siblings, 0 replies; 2+ messages in thread
From: rgb @ 2006-10-25 18:16 UTC (permalink / raw)
martin.blais@gmail.com wrote:
> Hi
>
> New gig, new environment, and I inherited two glorious 30-inch LCD
> monitors and a 24-in sidekick. Nice setup one would think, but my
> emacs windows are so unscrupulously large now that it takes me about 10
> seconds to find where my cursor is, even with blinking on. To
> alleviate the problem, I wrote an Emacs package that will briefly flash
> an overlay around the cursor when I switch frames.
> http://furius.ca/pubcode/pub/conf/common/elisp/blais/highwin.el
>
> While this is working well when switching between frames, I also need
> to flash my cursor when I switch between window manager windows (e.g.
> non-Emacs windows, the X-windows of other applications). That is, I
> need to be notified for enter-focus and leave-focus X events, somehow.
>
> I tried adding an advice on handle-switch-frame and make-frame-visible
> and a few other functions, and I cannot get it to work. There are no
> hooks I could find.
>
> Any idea? Can this be done?
I suppose you know about this...?
Most X window managers are set up so that just moving the mouse into a
window is enough to set the focus there. Emacs appears to do this,
because it changes the cursor to solid in the new frame. However, there
is no need for the Lisp program to know about the focus change until
some other kind of input arrives. So Emacs generates a focus event only
when the user actually types a keyboard key or presses a mouse button
in the new frame; just moving the mouse between frames does not
generate a focus event.
A focus event in the middle of a key sequence would garble the
sequence. So Emacs never generates a focus event in the middle of a key
sequence. If the user changes focus in the middle of a key
sequence-that is, after a prefix key-then Emacs reorders the events
so that the focus event comes either before or after the multi-event
key sequence, and not within it.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-10-25 18:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-25 16:54 Getting notified on focus events martin.blais
2006-10-25 18:16 ` rgb
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).