Subject: bug#745: pop-to-buffer, frames, and input focus

From: Helmut Eller <[email-masked]>
Date: Fri, 22 Aug 2008 16:27:22 +0200

* martin rudalics [2008-08-21 22:31+0200] writes:

>> pop-to-buffer doesn't switch input focus with: Sawfish, kwin,
>> metacity, fluxbox, twm.
>> It does with icewm.
>>
>> display-buffer seems to switch focus with: Sawfish, kwin, fluxbox,
>> icewm, twm.
>
> You probably mean display-buffer does _not_ switch focus with these.

I meant to say: display-buffer _does_ switch focus when creating a new
frame with those window managers: Sawfish, kwin, fluxbox, icewm, twm.

>> I still think that display-buffer should neither select the other frame
>> nor give it the input focus.  (Whether the other frame should be raised
>> or not should probably be customizable, but that's a minor issue.)
>
> I agree with you but I'm afraid there were issues with this.  If you
> have some spare time please look at the threads starting with
>
> http://lists.gnu.org/archive/html/emacs-devel/2006-04/msg00922.html
>
> http://lists.gnu.org/archive/html/emacs-devel/2005-11/msg00107.html
>
> http://lists.gnu.org/archive/html/emacs-devel/2008-03/msg00946.html
>
> respectively.  At the very least you will find out that you're not
> alone.

Those messages are several years old.  And it looks like nobody is
going to fix the issue this time.  

Maybe we could move the input focus to the selected frame in a lazy
fashion.  E.g. when Emacs waits for new events, we could compare the
currently focused frame with the selected frame, and if they differ we
could switch the focus to the selected frame.  This would make
select-frame more useful.

Helmut.