From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Steven Edwards 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 07:14:22 -0500 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: ger.gmane.org 1392466504 28695 80.91.229.3 (15 Feb 2014 12:15:04 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 15 Feb 2014 12:15:04 +0000 (UTC) To: 16761@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Feb 15 13:15:09 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 1WEe9F-0007V5-Cz for geb-bug-gnu-emacs@m.gmane.org; Sat, 15 Feb 2014 13:15:09 +0100 Original-Received: from localhost ([::1]:55966 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WEe9E-0001iY-Vi for geb-bug-gnu-emacs@m.gmane.org; Sat, 15 Feb 2014 07:15:08 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47332) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WEe9B-0001gZ-Ch for bug-gnu-emacs@gnu.org; Sat, 15 Feb 2014 07:15:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WEe99-00067B-KR for bug-gnu-emacs@gnu.org; Sat, 15 Feb 2014 07:15:05 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:51811) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WEe99-00066u-Ho for bug-gnu-emacs@gnu.org; Sat, 15 Feb 2014 07:15:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1WEe98-0005PV-Tm for bug-gnu-emacs@gnu.org; Sat, 15 Feb 2014 07:15:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Steven Edwards Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 15 Feb 2014 12:15:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 16761 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.139246647720745 (code B ref -1); Sat, 15 Feb 2014 12:15:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 15 Feb 2014 12:14:37 +0000 Original-Received: from localhost ([127.0.0.1]:52993 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WEe8i-0005OW-RF for submit@debbugs.gnu.org; Sat, 15 Feb 2014 07:14:37 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:45488) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WEe8g-0005OH-FX for submit@debbugs.gnu.org; Sat, 15 Feb 2014 07:14:35 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WEe8a-0005e9-16 for submit@debbugs.gnu.org; Sat, 15 Feb 2014 07:14:29 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:39515) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WEe8Z-0005e5-UW for submit@debbugs.gnu.org; Sat, 15 Feb 2014 07:14:27 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47209) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WEe8Y-0001HK-Gg for bug-gnu-emacs@gnu.org; Sat, 15 Feb 2014 07:14:27 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WEe8X-0005dd-3y for bug-gnu-emacs@gnu.org; Sat, 15 Feb 2014 07:14:26 -0500 Original-Received: from mail-la0-x235.google.com ([2a00:1450:4010:c03::235]:56788) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WEe8W-0005dS-Oe for bug-gnu-emacs@gnu.org; Sat, 15 Feb 2014 07:14:25 -0500 Original-Received: by mail-la0-f53.google.com with SMTP id e16so9866106lan.26 for ; Sat, 15 Feb 2014 04:14:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=JfhwzgT6ybS7yMdvIaQUtcpSMZ5+Vl6kJbQpjqL7YCY=; b=ighRGSH1KG0YW0i/7ZT2Ve+p8FuJZgZWw05jgQYjK6R0k5Fp9YuuNs1N7dFgMNnnZ4 6/Z8Of9pe3YWUvriqGj+hqirax5C2ILybTfei0jL1Nn8DRpFhpUEeQM+h38yFnCDdNqL KH0p9fQIarVUAyPycjwIx+zAJN5qGeZ6Z19PQArR7VgxfYnrIRpUTp6sLQ1O6JBtfEBY HukXBBa74Ay1R03sSgRiqNlWFsitc3EE+QdzJ+spW2qeWsv4X5HnAzWtfmkp2bmdKtFB 4uGErCxaMeOKQ5eZxp4q30oPQNEwgMrzvZkH/fgcAQFRj8uYLuoXVJuwOrptwm1wrQMZ 7VaA== X-Received: by 10.112.164.5 with SMTP id ym5mr1125397lbb.48.1392466462748; Sat, 15 Feb 2014 04:14:22 -0800 (PST) Original-Received: by 10.112.142.233 with HTTP; Sat, 15 Feb 2014 04:14:22 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). 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:85621 Archived-At: 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. The use case for this is that I'd like to use different themes for X frames and terminal frames. I know the use of window-system is deprecated; (framep (selected-frame)) does not work either. I hope this report helps. Best, Steven In GNU Emacs 24.3.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.20.1) of 2014-01-25 on Rand Windowing system distributor `The X.Org Foundation', version 11.0.11004000 System Description: Debian GNU/Linux 6.0.8 (squeeze) Important settings: value of $LC_CTYPE: en_US.UTF-8 value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: Emacs-Lisp Minor modes in effect: tooltip-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent input: C-x C-f . e m a c s C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-b C-x C-e C-x b C-g C-x C-f . e m a c s . d / l i TAB c u s TAB g l TAB C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-b C-x C-e C-n C-n C-n C-n C-n C-n C-a C-b C-x C-e C-x 5 2 M-x i d o - m o d e C-x b m e ESC [ > 1 ; 2 4 0 3 ; 0 c M-x r e p o r t - e m SPC SPC Recent messages: x#06:28:40.401223846 x#06:28:40.435829590 x#06:28:58.428023215 x#06:28:58.482460360 x#06:28:58.482890190 x#06:29:07.640302435 x#06:29:07.675357806 x#06:29:20.079938338 x#06:29:20.136675311 x#06:29:20.137121846 Load-path shadows: None found. Features: (shadow sort gnus-util mail-extr emacsbug message format-spec rfc822 mml easymenu mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util help-fns mail-prsvr mail-utils xterm ido server time-date tooltip electric uniquify ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment lisp-mode prog-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process dbusbind gfilenotify dynamic-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs)