From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#16479: 24.3.50; daemon freeze with tty menus Date: Mon, 20 Jan 2014 19:48:45 +0200 Message-ID: <8361peilxe.fsf@gnu.org> References: <87y52fgd5g.fsf@holos.localdomain> <83ha93kk5m.fsf@gnu.org> <87eh4652o0.fsf@holos.localdomain> <83fvomlv7w.fsf@gnu.org> <83eh46lsy5.fsf@gnu.org> <838uueljdv.fsf@gnu.org> <834n52l9qh.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1390240149 23643 80.91.229.3 (20 Jan 2014 17:49:09 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 20 Jan 2014 17:49:09 +0000 (UTC) Cc: mvoteiza@udel.edu, 16479@debbugs.gnu.org To: monnier@iro.umontreal.ca Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jan 20 18:49:15 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1W5IyJ-00011N-5V for geb-bug-gnu-emacs@m.gmane.org; Mon, 20 Jan 2014 18:49:15 +0100 Original-Received: from localhost ([::1]:53932 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W5IyI-0006Ct-Qz for geb-bug-gnu-emacs@m.gmane.org; Mon, 20 Jan 2014 12:49:14 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51493) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W5IyB-0006Cj-OH for bug-gnu-emacs@gnu.org; Mon, 20 Jan 2014 12:49:12 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W5Iy6-0006Mm-Vh for bug-gnu-emacs@gnu.org; Mon, 20 Jan 2014 12:49:07 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:44591) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W5Iy6-0006Mg-SE for bug-gnu-emacs@gnu.org; Mon, 20 Jan 2014 12:49:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1W5Iy6-0001ek-AD for bug-gnu-emacs@gnu.org; Mon, 20 Jan 2014 12:49:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 20 Jan 2014 17:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16479 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 16479-submit@debbugs.gnu.org id=B16479.13902401236313 (code B ref 16479); Mon, 20 Jan 2014 17:49:02 +0000 Original-Received: (at 16479) by debbugs.gnu.org; 20 Jan 2014 17:48:43 +0000 Original-Received: from localhost ([127.0.0.1]:58610 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W5Ixn-0001dk-1r for submit@debbugs.gnu.org; Mon, 20 Jan 2014 12:48:43 -0500 Original-Received: from mtaout22.012.net.il ([80.179.55.172]:57872) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W5Ixj-0001dU-IY for 16479@debbugs.gnu.org; Mon, 20 Jan 2014 12:48:41 -0500 Original-Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0MZP00900O31IP00@a-mtaout22.012.net.il> for 16479@debbugs.gnu.org; Mon, 20 Jan 2014 19:48:37 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MZP00919O51HN20@a-mtaout22.012.net.il>; Mon, 20 Jan 2014 19:48:37 +0200 (IST) In-reply-to: <834n52l9qh.fsf@gnu.org> X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 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.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:83799 Archived-At: > Date: Fri, 17 Jan 2014 20:54:46 +0200 > From: Eli Zaretskii > Cc: mvoteiza@udel.edu, 16479@debbugs.gnu.org > > > From: Stefan Monnier > > Cc: mvoteiza@udel.edu, 16479@debbugs.gnu.org > > Date: Fri, 17 Jan 2014 11:16:26 -0500 > > > > So, ideally (recursion-depth) should be >0 when inside the tty menus, > > and calling (top-level) should get us out of that tty menu. > > I'll see what I can do. Thanks. I think I see the root cause. It's in server-create-tty-frame, which does: (set-frame-parameter frame 'display (getenv-internal "DISPLAY" (process-get proc 'env))) (select-frame frame) IOW, it switches to the newly created TTY frame from under the feet of the menu input loop. When read_menu_command returns, the selected frame is different from what it was when the function was called. It is easy enough to detect the frame switch, but the question is: what to do when that happens? This is complicated by the fact that the frame switch event is not returned until some other event takes place. Thus, while the new frame is already selected, the old frame still has focus, until you type something. So to exit the vicious circle, you need to type something into the old frame (which causes the new frame to react), then switch to the new frame, and only then you are out of the woods. I'm unsure how best to handle this mess. Maybe avoid selecting the new frame in server-create-tty-frame, if a TTY menu is currently being displayed?