GNU bug report logs - #16761
24.3.50; focus-in-hook not running accurately when frame switches to terminal

Previous Next

Package: emacs;

Reported by: Steven Edwards <cureadvocate <at> gmail.com>

Date: Sat, 15 Feb 2014 12:15:02 UTC

Severity: normal

Found in version 24.3.50

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 16761 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Steven Edwards <cureadvocate <at> gmail.com>
Cc: Jan Djärv <jan.h.d <at> swipnet.se>, 16761 <at> debbugs.gnu.org
Subject: Re: 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
> Date: Sat, 15 Feb 2014 07:14:22 -0500
> From: Steven Edwards <cureadvocate <at> gmail.com>
> 
> 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#<frame *unsent mail to bug-gnu-emacs <at> gnu.org* 0xe88e40>06:40:47.325463985
> x#<frame *Messages* 0x1123978>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#<frame *Messages* 0x1123978>06:44:37.889809270
> x#<frame *Messages* 0x1123978>06:44:37.922339020
> x#<frame *unsent mail to bug-gnu-emacs <at> gnu.org* 0xe88e40>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#<frame emacs <at> Rand.launchmodem.com 0x352e880>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#<frame F2 0x11e90c8>06:56:53.533491550
> x#<frame emacs <at> Rand.launchmodem.com 0x352e880>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?




This bug report was last modified 3 years and 227 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.