From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.devel Subject: Re: mouse-autoselect-window Date: Tue, 18 Sep 2007 18:47:03 +0200 Message-ID: <46F00107.4030405@gmx.at> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------080608040707040101080907" X-Trace: sea.gmane.org 1190133969 18339 80.91.229.12 (18 Sep 2007 16:46:09 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 18 Sep 2007 16:46:09 +0000 (UTC) Cc: Stephen Berman , emacs-devel@gnu.org To: Drew Adams Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Sep 18 18:45:51 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IXgCp-0002su-Ij for ged-emacs-devel@m.gmane.org; Tue, 18 Sep 2007 18:45:47 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IXgCo-0000if-0e for ged-emacs-devel@m.gmane.org; Tue, 18 Sep 2007 12:45:46 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IXgCk-0000iT-NA for emacs-devel@gnu.org; Tue, 18 Sep 2007 12:45:42 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IXgCj-0000i2-Pe for emacs-devel@gnu.org; Tue, 18 Sep 2007 12:45:41 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IXgCj-0000hz-KE for emacs-devel@gnu.org; Tue, 18 Sep 2007 12:45:41 -0400 Original-Received: from mail.gmx.net ([213.165.64.20]) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1IXgCi-0006km-Rp for emacs-devel@gnu.org; Tue, 18 Sep 2007 12:45:41 -0400 Original-Received: (qmail invoked by alias); 18 Sep 2007 16:45:33 -0000 Original-Received: from N824P011.adsl.highway.telekom.at (EHLO [62.47.46.235]) [62.47.46.235] by mail.gmx.net (mp051) with SMTP; 18 Sep 2007 18:45:33 +0200 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX1+suzBzMK6s47WrnVx+0HNr9aWZGKSpVPYDukyh+s s6Ztt7CvKUMyHr User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: de-DE, de, en-us, en In-Reply-To: X-Y-GMX-Trusted: 0 X-Detected-Kernel: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:79210 Archived-At: This is a multi-part message in MIME format. --------------080608040707040101080907 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit >>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 ? --------------080608040707040101080907 Content-Type: text/plain; name="window-el.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="window-el.patch" *** 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) --------------080608040707040101080907 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel --------------080608040707040101080907--