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 raises frames Date: Thu, 11 Oct 2007 10:49:54 +0200 Message-ID: <470DE3B2.7010109@gmx.at> References: <470D3993.8040003@gmx.at> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1192092850 461 80.91.229.12 (11 Oct 2007 08:54:10 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 11 Oct 2007 08:54:10 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Oct 11 10:54:09 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 1Ifto0-0001s4-NG for ged-emacs-devel@m.gmane.org; Thu, 11 Oct 2007 10:54:09 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Iftnu-0002Zc-Ik for ged-emacs-devel@m.gmane.org; Thu, 11 Oct 2007 04:54:02 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Iftnp-0002ZB-Ay for emacs-devel@gnu.org; Thu, 11 Oct 2007 04:53:57 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Iftno-0002Yc-5Z for emacs-devel@gnu.org; Thu, 11 Oct 2007 04:53:56 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Iftnn-0002YY-Uy for emacs-devel@gnu.org; Thu, 11 Oct 2007 04:53:56 -0400 Original-Received: from mail.gmx.net ([213.165.64.20]) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1Iftnn-0003BJ-Hc for emacs-devel@gnu.org; Thu, 11 Oct 2007 04:53:55 -0400 Original-Received: (qmail invoked by alias); 11 Oct 2007 08:53:54 -0000 Original-Received: from N949P028.adsl.highway.telekom.at (EHLO [62.47.62.156]) [62.47.62.156] by mail.gmx.net (mp030) with SMTP; 11 Oct 2007 10:53:54 +0200 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX1/Xcvo9acbXupktgaTTTZ1YPxAGzTWR6UNzUf2rPj zqqHEEpq2CHOgr 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:80591 Archived-At: >>>I started to see frames raised while I was just moving my mouse. >>>Placing `debug-on-entry' on `raise-frame' showed the problem to be: >>> >>>Debugger entered--entering a function: >>>* raise-frame(#) >>>select-frame-set-input-focus(#) >>>handle-select-window((select-window (#))) >>>call-interactively(handle-select-window nil nil) >>> >>>I think the problem is that handle-select-window shouldn't call >>>select-frame-set-input-focus. It should maybe call x-focus-frame instead. > > >>Would that really be less embarassing? > > > I'm not sure I understand what you mean. I thought you were embarassed by seeing frames raised and wanted to know whether you find just focussing frames less embarassing. >>What are the values of `mouse-autoselect-window' and `focus-follows-mouse' >>on your system? > > > Both, but that's not relevant: handle-select-window should never call > "raise-frame". It calls `select-frame-set-input-focus' and the latter raises the frame. If you think it shouldn't, let's change `select-frame-set-input-focus' to do exactly what its name says and look what happens (note that `x-focus-frame' is not available on Windows installs). I changed the behavior of mouse-autoselection because people started to complain about modelines getting highlighted on frames that didn't get the focus. When debugging this I found out that I couldn't schedule a select_window event without also producing a switch_frame event. Hence I had to deal somehow with selected frames that did not get the focus. If you don't want the new behavior you currently can switch-off mouse autoselection or set `focus-follows-mouse' to nil. Inherently, `focus-follows-mouse' should be able to distinguish window management policies that shift input focus to another frame when the mouse enters it and policies that addditionally raise the frame whenever the mouse enters it. Hence, we could raise the frame in `handle-select-window' iff `focus-follows-mouse' eqs some value 'raise and x-focus the frame otherwise (I'm afraid the latter won't make any difference on Windows). Otherwise, we could consider a new variable `mouse-autoselect-frame' to customize the behavior of this.