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: Po Lu <luangruo <at> yahoo.com>
To: Andrey Listopadov <andreyorst <at> gmail.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: Sat, 15 Jul 2023 08:02:36 +0800
Andrey Listopadov <andreyorst <at> gmail.com> writes:

> Hello.
>
> I've tried making a mode that creates an alternative window manager
> within emacs that uses child frames on an infinite pannable desktop
> instead of window splits.  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.
>
> Am I supposed to delete focused child-frames in a different way or is it
> a bug?  I've tried using `handle-delete-frame' by passing it the list
> that resembles the event the function expects, but no luck.  I've also
> tried calling `select-frame' and `select-window' to change focus to the
> root window, but it doesn't help either.
>
>
> In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
>  3.24.38, cairo version 1.17.8) of 2023-07-07 built on toolbox
> Repository revision: 37101780243d083e8773c255242aa26614f22a14
> Repository branch: master
> System Description: Fedora Linux 38 (Container Image)
>
> Configured using:
>  'configure --without-compress-install --with-native-compilation=aot
>  --with-pgtk --with-mailutils --with-xwidgets
>  --prefix=/var/home/alist/.local'

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;

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.




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.