tags:

views:

196

answers:

1

Twice in the past two days, I've had a problem with my emacs sessions. Somehow emacs is keeping the focus within one frame. So, if I mouse over another frame and click in it, the cursor in the new frame stays put and the cursor in frame 1 moves as if I clicked in the corresponding position in it. Same happens with mouse-wheel scrolling. But not keyboard input.

Killing the hogging frame just causes another frame to become the hoarder.

My solution yesterday was to quit and restart emacs.

Some googling pointed me towards the variable focus-follows-mouse, but that appears to be set correctly (i.e. "t").

Any ideas what caused it and how to reset it?

(I'm using Ubuntu intrepid's package of emacs 22.2-0ubuntu2.)

+2  A: 

I have

(setq focus-follows-mouse t)
(setq mouse-autoselect-window t)

in my .emacs file, and find that this makes focus follow mouse work correctly. Maybe there's something else in your config that's changing emacs' behaviour, do you have your elisp in version control? Can you identify when this started happening, and look at changes to your elisp around then ?

Try starting emacs with --no-init-file and seeing if the undesired behaviour persists.

l0st3d
It's not an initialization issue. This emacs session was running for a long time before this behavior started. And when I started a new session, it worked fine.
AFoglia
I finally had this happen again. mouse-autoselect-window was nil, and setting it to t seems to have fixed it. (Oddly I needed to set it twice to get it to stick.) I'm not sure that's the problem, as my other emacs process has it set to nil and the mouse focus is working fine. But for lack of a better answer, and a solution that doesn't require restarting, I'll accept yours.
AFoglia