From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#17439: 24.3.50; run-with-idle-timer runs on focus-out Date: Mon, 12 May 2014 23:39:23 +0300 Organization: JURTA Message-ID: <877g5qoh7c.fsf@mail.jurta.org> References: <87ha50578c.fsf@mail.jurta.org> <834n0zwjne.fsf@gnu.org> <87r442ptpb.fsf@mail.jurta.org> <83r442upj2.fsf@gnu.org> <87ppjkkq20.fsf@mail.jurta.org> <87r440gfhf.fsf@mail.jurta.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1399928193 6343 80.91.229.3 (12 May 2014 20:56:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 12 May 2014 20:56:33 +0000 (UTC) Cc: 17439@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon May 12 22:56:25 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WjxGp-0002Z8-G5 for geb-bug-gnu-emacs@m.gmane.org; Mon, 12 May 2014 22:56:23 +0200 Original-Received: from localhost ([::1]:39793 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WjxGp-0002Yo-6V for geb-bug-gnu-emacs@m.gmane.org; Mon, 12 May 2014 16:56:23 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55910) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WjxGe-0002V8-SL for bug-gnu-emacs@gnu.org; Mon, 12 May 2014 16:56:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WjxGV-0006t5-Dp for bug-gnu-emacs@gnu.org; Mon, 12 May 2014 16:56:12 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:43839) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WjxGV-0006t1-Am for bug-gnu-emacs@gnu.org; Mon, 12 May 2014 16:56:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1WjxGV-0002Q0-3v for bug-gnu-emacs@gnu.org; Mon, 12 May 2014 16:56:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 12 May 2014 20:56:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17439 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 17439-submit@debbugs.gnu.org id=B17439.13999281629286 (code B ref 17439); Mon, 12 May 2014 20:56:02 +0000 Original-Received: (at 17439) by debbugs.gnu.org; 12 May 2014 20:56:02 +0000 Original-Received: from localhost ([127.0.0.1]:32956 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WjxGS-0002Pb-VJ for submit@debbugs.gnu.org; Mon, 12 May 2014 16:56:01 -0400 Original-Received: from alc-vshost7.dreamhost.com ([69.163.216.107]:51941 helo=ps18281.dreamhostps.com) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WjxGM-0002PI-K2 for 17439@debbugs.gnu.org; Mon, 12 May 2014 16:55:59 -0400 Original-Received: from localhost.jurta.org (ps18281.dreamhostps.com [69.163.222.226]) by ps18281.dreamhostps.com (Postfix) with ESMTP id 7FB1330A1CE8A3; Mon, 12 May 2014 13:55:52 -0700 (PDT) In-Reply-To: (Stefan Monnier's message of "Sun, 11 May 2014 18:29:19 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (x86_64-pc-linux-gnu) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:88997 Archived-At: >>>> + ;; but `raise-frame' forcibly switches to an Emacs frame >>>> when the Window List is active, > > Well, this behavior is a choice of the window-manager. While I'm very > happy to call raise-frame less often (so I generally agree with the > direction of the patch), you could argue that this might be a bug in the > window-manager. raise-frame causes more trouble, e.g. when another application is in full-screen mode, then they both fight for which of them should stay on the top, so typing a key in Emacs re-raises the selected Emacs frame, and then another application brings itself to the front. A comment in `mouse-avoidance-set-mouse-position' explains its rationale: ;; Ideally, should check if X,Y is in the current frame, and if not, ;; leave the mouse where it was. However, this is currently ;; difficult to do, so we just raise the frame to avoid frame switches. But actually such check already exists in `mouse-avoidance-ignore-p': (not (eq (car (mouse-position)) (selected-frame))) and the mouse pointer is not moved when it's outside of the selected frame. So I really see no problems with this patch: === modified file 'lisp/avoid.el' --- lisp/avoid.el 2014-01-01 07:43:34 +0000 +++ lisp/avoid.el 2014-05-12 20:31:28 +0000 @@ -52,9 +52,6 @@ ;; ;; - Using this code does slow Emacs down. "banish" mode shouldn't ;; be too bad, and on my workstation even "animate" is reasonable. -;; -;; - It ought to find out where any overlapping frames are and avoid them, -;; rather than always raising the frame. ;; Credits: ;; This code was helped by all those who contributed suggestions, @@ -172,12 +170,8 @@ (defun mouse-avoidance-point-position () (defun mouse-avoidance-set-mouse-position (pos) ;; Carefully set mouse position to given position (X . Y) - ;; Ideally, should check if X,Y is in the current frame, and if not, - ;; leave the mouse where it was. However, this is currently - ;; difficult to do, so we just raise the frame to avoid frame switches. ;; Returns t if it moved the mouse. (let ((f (selected-frame))) - (raise-frame f) (set-mouse-position f (car pos) (cdr pos)) t)) @@ -342,7 +336,7 @@ (defun mouse-avoidance-ignore-p () (let ((modifiers (event-modifiers (car last-input-event)))) (or (memq (car last-input-event) '(mouse-movement scroll-bar-movement - select-window switch-frame)) + select-window focus-out)) (memq 'click modifiers) (memq 'double modifiers) (memq 'triple modifiers) @@ -403,8 +403,6 @@ (defun mouse-avoidance-mode (&optional m * cat-and-mouse: Same as `animate'. * proteus: As `animate', but changes the shape of the mouse pointer too. -Whenever the mouse is moved, the frame is also raised. - \(See `mouse-avoidance-threshold' for definition of \"too close\", and `mouse-avoidance-nudge-dist' and `mouse-avoidance-nudge-var' for definition of \"random distance\".)"