emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: mouse-autoselect-window


From: martin rudalics
Subject: Re: mouse-autoselect-window
Date: Tue, 18 Sep 2007 18:47:03 +0200
User-agent: Mozilla Thunderbird 1.0 (Windows/20041206)

>>You're right.  But I can't use `select-frame-set-input-focus' because it
>>might move the mouse pointer as well.
>
>
> (I don't remember what the problem with that is.)

It's unrelated so we can use `select-frame-set-input-focus' here.

> `frame' is unbound here. Let-bind it to (window-frame window), and it works:

Yes.

> This is an improvement, for me, but, as I said, it would be better if the
> focus could be changed without necessarily raising the frame also. Those
> should be two separate choices: focus & raise.

I suppose we can do that by using either `my_set_focus' or
`my_set_foreground_window'.  I'll try to come up with a solution.

> That seems to have no effect - the frame is raised even without the call to
> `raise-frame'. I presume that is because `w32-focus-frame', as its doc
> string says, gives "FRAME input focus, raising to foreground if necessary".
> Perhaps there is no way around this raising on Windows? Does someone know?
>
> Again, to me, this is an improvement, even if the frame does get raised, but
> if we could prevent raising (unless the user asks for that), that would be
> better.

I agree.  I haven't tested this with multiple frames because I hardly
ever use them.

Stephen could you try the attached patch on GNU/Linux ?
*** window.el.~1.120.2.2.~      Wed Aug  8 23:12:06 2007
--- window.el   Tue Sep 18 18:45:20 2007
***************
*** 921,927 ****
        (setq mouse-autoselect-window-state nil)
        (when mouse-autoselect-window
          ;; Run `mouse-leave-buffer-hook' when autoselecting window.
!         (run-hooks 'mouse-leave-buffer-hook))
        (select-window window)))))
  
  (define-key ctl-x-map "2" 'split-window-vertically)
--- 921,932 ----
        (setq mouse-autoselect-window-state nil)
        (when mouse-autoselect-window
          ;; Run `mouse-leave-buffer-hook' when autoselecting window.
!         (run-hooks 'mouse-leave-buffer-hook)
!         (unless focus-follows-mouse
!           ;; Make sure frame is focussed when autoselecting window and
!           ;; we assume that the window manager does not focus the
!           ;; frame of window.
!           (select-frame-set-input-focus (window-frame window))))
        (select-window window)))))
  
  (define-key ctl-x-map "2" 'split-window-vertically)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]