From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Marshall, Simon" Newsgroups: gmane.emacs.devel Subject: RE: [simon.marshall@misys.com: mouse-autoselect-window needs a de lay] Date: Thu, 6 Jul 2006 12:43:54 +0100 Message-ID: <81CCA6588E60BB42BE68BD029ED48260080E12B4@wimex2.wim.midas-kapiti.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: sea.gmane.org 1152186395 6813 80.91.229.2 (6 Jul 2006 11:46:35 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 6 Jul 2006 11:46:35 +0000 (UTC) Cc: "'cyd@stupidchicken.com'" , "'rms@gnu.org'" , "'emacs-devel@gnu.org'" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jul 06 13:46:29 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FySIA-0007W2-40 for ged-emacs-devel@m.gmane.org; Thu, 06 Jul 2006 13:45:10 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FySI9-0008Q2-LJ for ged-emacs-devel@m.gmane.org; Thu, 06 Jul 2006 07:45:09 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FySHw-0008PQ-UX for emacs-devel@gnu.org; Thu, 06 Jul 2006 07:44:56 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FySHu-0008PE-RP for emacs-devel@gnu.org; Thu, 06 Jul 2006 07:44:56 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FySHu-0008P7-Lv for emacs-devel@gnu.org; Thu, 06 Jul 2006 07:44:54 -0400 Original-Received: from [217.68.146.190] (helo=cluster-b.mailcontrol.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1FySI4-00008M-G8; Thu, 06 Jul 2006 07:45:04 -0400 Original-Received: from rly23b.srv.mailcontrol.com (localhost.localdomain [127.0.0.1]) by rly23b.srv.mailcontrol.com (MailControl) with ESMTP id k66Biljx015813 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 6 Jul 2006 12:44:49 +0100 Original-Received: from submission.mailcontrol.com (submission.mailcontrol.com [212.158.48.250]) by rly23b.srv.mailcontrol.com (MailControl) id k66BijLi015746; Thu, 6 Jul 2006 12:44:45 +0100 Original-Received: from wimex2.wim.midas-kapiti.com ([217.196.233.101]) by rly23b-eth0.srv.mailcontrol.com (envelope-sender simon.marshall@misys.com) (MIMEDefang) with ESMTP id k66BiioM015693; Thu, 06 Jul 2006 12:44:45 +0100 (BST) Original-Received: by wimex2.wim.midas-kapiti.com with Internet Mail Service (5.5.2657.72) id ; Thu, 6 Jul 2006 12:43:56 +0100 Original-To: "'martin rudalics'" X-Mailer: Internet Mail Service (5.5.2657.72) X-Scanned-By: MailControl A-07-00-10 (www.mailcontrol.com) on 10.66.1.133 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:56625 Archived-At: > Please try the attached patch - it's based on Stefan's > suggestion to use `handle-select-window'. martin. Hi Martin, thanks, I can play with the lisp now. One problem I see with this implementation is that it also waits for twice the delay. The reason can be seen in the sequence of events when the mouse is moved to a new window: - handle-select-window calls autoselect-window-start. - autoselect-window-start sets autoselect-window-position to (mouse-position). However, this position appears to be the position *before* the mouse movement. - autoselect-window-start starts a timer to run autoselect-window-select after the specified delay. - when autoselect-window-select runs after the first timeout, it checks to see if autoselect-window-position is equal to (mouse-position), which cannot be true even if the mouse has not moved again. So, window selection does not occur, and it just sets autoselect-window-position to (mouse-position). - when autoselect-window-select runs after the second timeout, and the mouse has not moved, autoselect-window-position is equal to (mouse-position) and window selection occurs. To be honest, I'd be quite happy with the feature if it did not try to detect for a quiescent mouse as it would still be a big improvement. In that case I guess the implementation would not need to use (mouse-position) and the above problem would not occur. If it could be made to work, it would be a bonus (though perhaps should be an additional option, i.e., delay or delay with quiescence). Of course, one simple hack/workaround would be to use (/ mouse-autoselect-window 2.0) for the timer delay, though I'd be interested to see why mouse-position returns what it does. Simon.