From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.devel Subject: RE: mouse-autoselect-window Date: Tue, 18 Sep 2007 07:41:07 -0700 Message-ID: References: <46EF781A.2050306@gmx.at> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-15" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1190126511 18454 80.91.229.12 (18 Sep 2007 14:41:51 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 18 Sep 2007 14:41:51 +0000 (UTC) Cc: emacs-devel@gnu.org To: "martin rudalics" , "Stephen Berman" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Sep 18 16:41:48 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 1IXeGp-0001mJ-Be for ged-emacs-devel@m.gmane.org; Tue, 18 Sep 2007 16:41:48 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IXeGm-0003Ww-VU for ged-emacs-devel@m.gmane.org; Tue, 18 Sep 2007 10:41:45 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IXeGO-0003Nz-FA for emacs-devel@gnu.org; Tue, 18 Sep 2007 10:41:20 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IXeGN-0003Nc-QO for emacs-devel@gnu.org; Tue, 18 Sep 2007 10:41:20 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IXeGN-0003NY-N8 for emacs-devel@gnu.org; Tue, 18 Sep 2007 10:41:19 -0400 Original-Received: from agminet01.oracle.com ([141.146.126.228]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1IXeGN-0001ib-5M for emacs-devel@gnu.org; Tue, 18 Sep 2007 10:41:19 -0400 Original-Received: from agmgw2.us.oracle.com (agmgw2.us.oracle.com [152.68.180.213]) by agminet01.oracle.com (Switch-3.2.4/Switch-3.1.7) with ESMTP id l8IEfF75011967; Tue, 18 Sep 2007 09:41:15 -0500 Original-Received: from acsmt351.oracle.com (acsmt351.oracle.com [141.146.40.151]) by agmgw2.us.oracle.com (Switch-3.2.0/Switch-3.2.0) with ESMTP id l8IBWwY8018750; Tue, 18 Sep 2007 08:41:14 -0600 Original-Received: from dhcp-amer-csvpn-gw1-141-144-65-85.vpn.oracle.com by acsmt350.oracle.com with ESMTP id 3222511821190126466; Tue, 18 Sep 2007 07:41:06 -0700 X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) In-Reply-To: <46EF781A.2050306@gmx.at> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3138 Importance: Normal X-Brightmail-Tracker: AAAAAQAAAAI= X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-Whitelist: TRUE X-Detected-Kernel: Linux 2.4-2.6 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:79197 Archived-At: > > I disagree. I'm running Emacs on GNU/Linux under KDE, I have a > > click-to-focus policy but also have mouse-autoselect-window set to t, > > because I want to have autoselection between split windows within a > > single frame. I also observe the same behavior that Drew Adams > > described. > > I'm afraid that autoselection between windows of the same frame only > is somewhat very difficult to achieve. The attached patch should > correct the behavior observed by Drew though. Could you please try? Yes and no (for me, on Windows). It raises the frame, but it does not give it the input focus. I had already said (on 2007-09-05) that giving focus to the frame at the cost of raising it was a possibility: > BTW, `mouse-autoselect-window' _could_ select the mouse window in MS > Windows, even on another frame, at the cost of also raising that frame - > just add `select-frame-set-input-focus' to its code. However, I'm not sure > that is a good idea. I assume that on GNU/Linux etc. the focus moves but > the window is not raised - that's the behavior I would prefer, anyway. I mentioned `select-frame-set-input-focus', whereas you used `raise-frame'. The effect wrt raising is the same, but your fix does not change the input focus (for me, on Windows). I personally think that it would be OK to raise the frame too, if focus cannot be given to it otherwise, but what would really be desirable is to give focus to the frame (and window) without raising it. I don't know if that is always possible (e.g. on MS Windows), but when it is possible, it is, I think, the appropriate behavior. Ideally, with customizable options, users would be able to control, separately, autofocus and autoraise. I also see another problem with your fix (it might not be due to the fix itself, however). It doesn't always seem to raise the right frame. I don't know why. I don't know if others will see the same problem. If I have a narrow frame on top of a wider frame that has two windows, top and bottom, then moving the mouse from the bottom window to the top actually raises the other (narrow) frame, instead of just giving the focus to the top window. If frame 2 is directly under frame 1, then moving the mouse from window B to window A should focus window A, but instead it raises frame 2. Frame 1: ............. | | | A | |___________| | | | B | |...........| Frame 2: ....... | | | | | | | | | | |.....| The behavior is actually erratic - sometimes it raises frame 2, sometimes it does not. I'd suggest trying with `select-frame-set-input-focus' instead of `raise-frame'. For me, that DTRT (except that it would be even better to be able to focus frame input without necessarily also raising it).