GNU bug report logs - #64625
30.0.50; deleting a focused child frame causes Emacs to ignore all input

Previous Next

Package: emacs;

Reported by: Andrey Listopadov <andreyorst <at> gmail.com>

Date: Fri, 14 Jul 2023 17:21:01 UTC

Severity: normal

Found in version 30.0.50

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Godefroy Vannoye <godefroy.vannoye <at> gmail.com>, Po Lu <luangruo <at> yahoo.com>
Cc: 64625 <at> debbugs.gnu.org
Subject: bug#64625: 30.0.50; deleting a focused child frame causes Emacs to ignore all input
Date: Wed, 21 May 2025 16:22:05 +0300
> Date: Tue, 20 May 2025 17:24:02 +0200
> From: Godefroy Vannoye <godefroy.vannoye <at> gmail.com>
> 
> Hi,
> 
> > When I've implemented the button that closes
> > the window, I've noticed, that when I'm closing the last input, Emacs
> > stops recognizing any keyboard events, and the point in the root window
> > disappears.
> >
> > This can be reproduced with the following steps:
> >
> > 1. Call (make-frame `((parent-frame . ,(selected-frame))))
> > 2. Focus the newly created child-frame (with a mouse or elsehow)
> > 3. Call C-x 5 0 to kill the frame.
> > 4. Try typing or calling M-x in the original Emacs window.
> >
> > Weirdly enough, the only thing that Emacs responds to and restores the
> > focus are the arrow keys. You can also go to File > New Frame menu and
> > it will fix the issue for the new frame, but the old one is still
> > broken.
> 
> I've been stumbling upon the same issue, on Emacs pretest 30.1.90.

Seems like PGTK-specific?

> 
> > Thanks. Would you please instrument `pgtk_new_focus_frame' (in
> > pgtkterm.c) as follows:
> >
> > diff --git a/src/pgtkterm.c b/src/pgtkterm.c
> > index dc2d6477bb5..d62414f4e50 100644
> > --- a/src/pgtkterm.c
> > +++ b/src/pgtkterm.c
> > @@ -4732,6 +4732,9 @@ pgtk_new_focus_frame (struct pgtk_display_info 
> > *dpyinfo,
> > struct frame *frame)
> > if (frame != dpyinfo->x_focus_frame)
> > {
> > + fprintf (stderr, "pgtk_new_focus_frame: new frame %p, "
> > + "with outer widget %p\n", (void *) frame,
> > + (void *) FRAME_GTK_OUTER_WIDGET (frame));
> > /* Set this before calling other routines, so that they see
> > the correct value of x_focus_frame. */
> > dpyinfo->x_focus_frame = frame;
> 
> I've also instrumented `pgtk_new_focus_frame' (in pgtkterm.c) in a slightly
> different way than suggested, to avoid an Emacs crash:
> 
>    if (frame != dpyinfo->x_focus_frame)
>      {
> +     fprintf (stderr, "pgtk_new_focus_frame: new frame %p", (void *) 
> frame);
> +     if (frame) {
> +       fprintf (stderr, ", with outer widget %p\n", (void *) 
> FRAME_GTK_OUTER_WIDGET (frame));
> +     }
> +     else {
> +       fprintf(stderr, "\n");
> +     }
>        /* Set this before calling other routines, so that they see
>           the correct value of x_focus_frame.  */
>        dpyinfo->x_focus_frame = frame;
> 
> > and show me what is printed when the child frame is initially focused,
> > and when you try to focus its parent after it is deleted.
> When the child frame is initially focused:
> 
>      pgtk_new_focus_frame: new frame (nil)
>      pgtk_new_focus_frame: new frame 0x555821d935d0, with outer widget (nil)
> 
> When I try to focus the parent after it is deleted, nothing is printed. 
> When I do
> the arrow key manipulation to make the frame reactive again, the 
> following is printed:
> 
>      pgtk_new_focus_frame: new frame 0x55e133e383f8, with outer widget 
> 0x55e133ce6b20
> 
> Thanks in advance for any possible progress of this bug,
> and I stay at your disposal for any necessary test.
> 
> Godefroy Vannoye
> 
> 
> In GNU Emacs 30.1.90 (build 14, x86_64-pc-linux-gnu, GTK+ Version
>   3.24.49, cairo version 1.18.4) of 2025-05-20 built on gvlaptop
> System Description: Arch Linux
> 
> Configured using:
>   'configure --with-pgtk --with-tree-sitter'




This bug report was last modified 14 days ago.

Previous Next


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