unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Steven Edwards <cureadvocate@gmail.com>
Cc: 16761@debbugs.gnu.org
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	[thread overview]
Message-ID: <83eh34bg7v.fsf@gnu.org> (raw)
In-Reply-To: <CAA3vWKCdxPjNYgYhQg7wV6-8a5ukh91UMKKThyoML9NOE_89Xw@mail.gmail.com>

> Date: Sat, 15 Feb 2014 07:14:22 -0500
> From: Steven Edwards <cureadvocate@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@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@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@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@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?





  reply	other threads:[~2014-02-15 14:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-15 12:14 bug#16761: 24.3.50; focus-in-hook not running accurately when frame switches to terminal Steven Edwards
2014-02-15 14:31 ` Eli Zaretskii [this message]
2014-02-15 17:04   ` Steven Edwards
2014-02-15 17:14     ` Eli Zaretskii
2014-02-15 17:23       ` Steven Edwards
2014-02-15 20:39         ` Eli Zaretskii
2021-12-04  3:27 ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83eh34bg7v.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=16761@debbugs.gnu.org \
    --cc=cureadvocate@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).