From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#17439: 24.3.50; run-with-idle-timer runs on focus-out Date: Sun, 11 May 2014 18:29:19 -0400 Message-ID: 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 1399847431 8879 80.91.229.3 (11 May 2014 22:30:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 11 May 2014 22:30:31 +0000 (UTC) Cc: 17439@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon May 12 00:30:22 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 1WjcGE-000220-39 for geb-bug-gnu-emacs@m.gmane.org; Mon, 12 May 2014 00:30:22 +0200 Original-Received: from localhost ([::1]:34531 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WjcGD-0002KT-NR for geb-bug-gnu-emacs@m.gmane.org; Sun, 11 May 2014 18:30:21 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40240) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WjcG3-0002KK-KE for bug-gnu-emacs@gnu.org; Sun, 11 May 2014 18:30:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WjcFw-0007ax-0y for bug-gnu-emacs@gnu.org; Sun, 11 May 2014 18:30:11 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:42456) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WjcFv-0007ai-Ue for bug-gnu-emacs@gnu.org; Sun, 11 May 2014 18:30:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1WjcFv-0002WN-89 for bug-gnu-emacs@gnu.org; Sun, 11 May 2014 18:30:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 11 May 2014 22:30:03 +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.13998473709627 (code B ref 17439); Sun, 11 May 2014 22:30:03 +0000 Original-Received: (at 17439) by debbugs.gnu.org; 11 May 2014 22:29:30 +0000 Original-Received: from localhost ([127.0.0.1]:59807 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WjcFN-0002VC-JE for submit@debbugs.gnu.org; Sun, 11 May 2014 18:29:30 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:14204) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WjcFL-0002Uy-1N for 17439@debbugs.gnu.org; Sun, 11 May 2014 18:29:27 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArYGAIDvNVMXW5vY/2dsb2JhbABZgwaDSr0vgw6BFxd0giUBAQEBAgFWIwULCzQSFBgNJIgECNIZF456B4Q4BKsDg0wh X-IPAS-Result: ArYGAIDvNVMXW5vY/2dsb2JhbABZgwaDSr0vgw6BFxd0giUBAQEBAgFWIwULCzQSFBgNJIgECNIZF456B4Q4BKsDg0wh X-IronPort-AV: E=Sophos; i="4.97,753,1389762000"; d="scan'208,217"; a="62374199" Original-Received: from 23-91-155-216.cpe.pppoe.ca (HELO pastel.home) ([23.91.155.216]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 11 May 2014 18:29:20 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 011EC600A4; Sun, 11 May 2014 18:29:19 -0400 (EDT) In-Reply-To: <87r440gfhf.fsf@mail.jurta.org> (Juri Linkov's message of "Mon, 12 May 2014 00:31:48 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) 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:88942 Archived-At: >> Huh? `run-with-idle-timer' is not supposed to generate any event. > It runs on `focus-out', It does. But that doesn't mean that "`run-with-idle-timer' generates the `focus-out'". The `focus-out' event is generated by the window-manager plus Emacs's C code in response to some situation such as a user action. And after execution of the command bound to `focus-out', we run the idle timers. > (defun test () (message "%S" last-input-event)) > (setq timer (run-with-idle-timer 0.1 t 'test)) > It generates: > (focus-in #) > (focus-out #) Your code generates some output which mentions `focus-out' but it did not generate those events. >>> + ;; Some window managers generate the `focus-in' event >>> + ;; when showing the Window List, >> What means "showing the Window List"? > It depends on the desktop environment, but usually this is a list of windows > shown after typing Alt-Tab. Then I still don't understand: why would Emacs get a focus-in event when the window-manager shows the "Window List"? I'd maybe expect a focus-*out* event, since suddenly the focus might go from Emacs to the Window List. Or do you mean that Emacs gets a focus-in event when the user selects an Emacs frame in the window manager's Window List (maybe even if that selection is transient while looping through all windows)? >>> + ;; 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. > This is specific behavior observed at least in one window manager (Gnome 2), > where typing Alt-Tab shows the Window List and generates the `focus-in' event > in Emacs at the same time. OK, I think I understand. Please make the comment a bit more clear about the fact that the focus-in event might come even *while* (rather than *when*) the "Window List thingy to select a window" is active. > But maybe it should be handled like `focus-in', i.e. also > to not ignore it in `mouse-avoidance-ignore-p' and to move > the mouse pointer after switching between Emacs frames. I don't have a strong opinion either way, but it seems like they generally should be handled in the same way, since they occur in similar circumstances (one being when you focus-in from another frame of the same Emacs session, while the other is when you focus-in from some other process). Stefan