From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs 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 Message-ID: <875y6m9h43.fsf@yahoo.com> References: <87ilamtnoe.fsf@gmail.com> Reply-To: Po Lu Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19436"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 64625@debbugs.gnu.org To: Andrey Listopadov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jul 15 02:03:14 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qKSkk-0004qU-D2 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 15 Jul 2023 02:03:14 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qKSkZ-0001g3-M9; Fri, 14 Jul 2023 20:03:03 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qKSkY-0001fi-CC for bug-gnu-emacs@gnu.org; Fri, 14 Jul 2023 20:03:02 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qKSkY-0003kh-3h for bug-gnu-emacs@gnu.org; Fri, 14 Jul 2023 20:03:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qKSkX-0002L5-VE for bug-gnu-emacs@gnu.org; Fri, 14 Jul 2023 20:03:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Po Lu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 15 Jul 2023 00:03:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64625 X-GNU-PR-Package: emacs Original-Received: via spool by 64625-submit@debbugs.gnu.org id=B64625.16893793728969 (code B ref 64625); Sat, 15 Jul 2023 00:03:01 +0000 Original-Received: (at 64625) by debbugs.gnu.org; 15 Jul 2023 00:02:52 +0000 Original-Received: from localhost ([127.0.0.1]:43658 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qKSkO-0002Ka-EJ for submit@debbugs.gnu.org; Fri, 14 Jul 2023 20:02:52 -0400 Original-Received: from sonic310-25.consmr.mail.ne1.yahoo.com ([66.163.186.206]:36174) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qKSkM-0002KF-KF for 64625@debbugs.gnu.org; Fri, 14 Jul 2023 20:02:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1689379363; bh=Q8AM4H4jCnVxUh47sMnVqtmpT474uypAWD57uKDB+5Y=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From:Subject:Reply-To; b=m1EePWM1SPJrx8tgAlalFcb8M8ITAFZcnZyk/9PY6nYFXTWr668Ty83qqyz2TyA6jVd1tdKYJdaC1j0sT7nvyJJBHRkc+3/x9jfmfHZELp9DLzbSLpL43thth7lFUwV3De8U8F9mUTYplXH0LcOKcgFqU6xZ4mSGy/SoiUb8kxoreauJvPwaM3T2KDp9cMsR92gM/1Ev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UfTlPY3aPw4vDWTtOwQJ4Pu1 b.R6UwzjYYluAHuBoHRjOGuRkZqReoFkwAwR7ObHPjEYXCDeXWC0CKy4mPbcf9F26Zzjo0nB52rE _qgeVKE2Li..adN3g1A8EMnyZW3hrKfybpmyJg8Rb0ftv183vW1_3nop1k_lCoukJGfqhbcn9le3 uHB6y35XMLOsVR.5lLQaJbvjMQvD.FlOV0ArxuTu0SFHKMRxppSdRPeFHPwm3lweczOQpajB8Gjp XfWrado2_lAZRmwzWIjmMOobIrpthhMaTwBhY8f9iLFbqvdSAmO3lDN.ySpifR73dNOxT0A2Fckm crg1TnBP.BaCgZ2oBCuvEOBK3ytoXoRDuPW072lqiSzWV7UN1WcMHbOQ_S_DELdw1DWYAxQ4Zkd7 hPOKWzsAaHljcb.SP9wPNhvvWJ2ZZYHN5KSZhP0K6a X-Sonic-MF: X-Sonic-ID: 053d314f-4290-4d8b-8f0d-4ee20d303785 Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic310.consmr.mail.ne1.yahoo.com with HTTP; Sat, 15 Jul 2023 00:02:43 +0000 Original-Received: by hermes--production-sg3-67fd64777-vq8mf (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID ee0a0b7a1c4f144056dcf077bfd7823e; Sat, 15 Jul 2023 00:02:40 +0000 (UTC) In-Reply-To: <87ilamtnoe.fsf@gmail.com> (Andrey Listopadov's message of "Fri, 14 Jul 2023 20:12:18 +0300") X-Mailer: WebService/1.1.21647 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:265134 Archived-At: Andrey Listopadov 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.