From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#16761: 24.3.50; focus-in-hook not running accurately when frame switches to terminal Date: Sat, 15 Feb 2014 16:31:00 +0200 Message-ID: <83eh34bg7v.fsf@gnu.org> References: Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1392474733 13136 80.91.229.3 (15 Feb 2014 14:32:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 15 Feb 2014 14:32:13 +0000 (UTC) Cc: 16761@debbugs.gnu.org To: Steven Edwards Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Feb 15 15:32:20 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 1WEgHy-0003aE-A7 for geb-bug-gnu-emacs@m.gmane.org; Sat, 15 Feb 2014 15:32:18 +0100 Original-Received: from localhost ([::1]:56853 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WEgHx-0000Gy-IJ for geb-bug-gnu-emacs@m.gmane.org; Sat, 15 Feb 2014 09:32:17 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38663) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WEgHq-0000Ge-4f for bug-gnu-emacs@gnu.org; Sat, 15 Feb 2014 09:32:15 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WEgHk-0002Gr-R7 for bug-gnu-emacs@gnu.org; Sat, 15 Feb 2014 09:32:10 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:51873) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WEgHk-0002Gn-NR for bug-gnu-emacs@gnu.org; Sat, 15 Feb 2014 09:32:04 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1WEgHj-00026K-78 for bug-gnu-emacs@gnu.org; Sat, 15 Feb 2014 09:32:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 15 Feb 2014 14:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16761 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 16761-submit@debbugs.gnu.org id=B16761.13924746747970 (code B ref 16761); Sat, 15 Feb 2014 14:32:02 +0000 Original-Received: (at 16761) by debbugs.gnu.org; 15 Feb 2014 14:31:14 +0000 Original-Received: from localhost ([127.0.0.1]:53055 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WEgGu-00024O-WE for submit@debbugs.gnu.org; Sat, 15 Feb 2014 09:31:13 -0500 Original-Received: from mtaout26.012.net.il ([80.179.55.182]:53649) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WEgGp-00023l-CZ for 16761@debbugs.gnu.org; Sat, 15 Feb 2014 09:31:09 -0500 Original-Received: from conversion-daemon.mtaout26.012.net.il by mtaout26.012.net.il (HyperSendmail v2007.08) id <0N1100E00JYTC200@mtaout26.012.net.il> for 16761@debbugs.gnu.org; Sat, 15 Feb 2014 16:29:29 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout26.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N11007NBK95QI90@mtaout26.012.net.il>; Sat, 15 Feb 2014 16:29:29 +0200 (IST) In-reply-to: X-012-Sender: halo1@inter.net.il 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:85622 Archived-At: > Date: Sat, 15 Feb 2014 07:14:22 -0500 > From: Steven Edwards > > Starting from emacs -Q: > > --- > (server-start) > (defun rand/on-focus () > (message (concat (prin1-to-string window-system) (prin1-to-string > (selected-frame)) (format-time-string "%H:%M:%S.%N")))) > (add-hook 'focus-in-hook 'rand/on-focus) > --- > > Open another graphical frame with C-x 5 2; switch it to *Messages* buffer. > > Next open a non-graphical frame with emacsclient -nw. > > You should now have three frames open. > > Switch frames from one to the next. (I'm using the awesome window > manager, so Super-J.) > > You'll notice that when switching from one graphical frame to the next, > two messages appear, e.g.: > > --- > x#06:40:47.325463985 > x#06:40:47.384926969 > --- > > ...but when cycling from a graphical frame to a terminal frame, nothing new > appears in *Messages*--until you switch to a graphical frame: > > --- > x#06:44:37.889809270 > x#06:44:37.922339020 > x#06:44:37.922801690 > --- > > If you perform any actions on the terminal frame after switching switch > from a graphical frame, *Messages* will receive one message--as if > focus-in-hooks are being called from focus-out-hooks: > > --- > x#06:56:51.097246751 > --- > > Switching to a raphical frame after performing an action on the terminal > frame will finally send a message containing the terminal frame object, > but only after it loses focus: > > --- > nil#06:56:53.533491550 > x#06:56:53.533998714 > --- > > Possibly related, C-x 5 o skips over any terminal frames and C-x 5 1 > won't delete terminal frames. You don't say what you expect to happen. Do you expect a focus-in and focus-out event to be generated for terminal frames? Or do you expect (or need) something else?