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#13864: 24.3.50; emacsclient -t loops when connected to emacs server running in X11 Date: Tue, 02 Apr 2013 20:10:16 +0300 Message-ID: <83wqskj1tz.fsf@gnu.org> References: <86y5e4xpd8.fsf@chateau.d.if> <86mwujou60.fsf@chateau.d.if> <83y5e2synt.fsf@gnu.org> <86ip56adz3.fsf@chateau.d.if> <83txoo1mp3.fsf@gnu.org> <868v60743o.fsf@chateau.d.if> <83ppzc1bx9.fsf@gnu.org> <866214m1bh.fsf@chateau.d.if> <838v5z1yx4.fsf@gnu.org> <86mwuf8xrq.fsf@chateau.d.if> <8362131sf1.fsf@gnu.org> <86ip538qb8.fsf@chateau.d.if> <83y5dzz88b.fsf@gnu.org> <868v5y9pb5.fsf@chateau.d.if> <837glhzxvs.fsf@gnu.org> <86sj3zy8ru.fsf@chateau.d.if> <83620t57e1.fsf@gnu.org> <864ng3hae1.fsf@chateau.d.if> <83k3ow376r.fsf@gnu.org> <86li9bde1j.fsf@chateau.d.if> <831ub33fzt.fsf@gnu.org> <861uau6vyd.fsf@chateau.d.if> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1364922611 19112 80.91.229.3 (2 Apr 2013 17:10:11 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 2 Apr 2013 17:10:11 +0000 (UTC) Cc: 13864@debbugs.gnu.org To: ashish.is@lostca.se (Ashish SHUKLA) Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Apr 02 19:10:38 2013 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 1UN4jF-0003vi-R7 for geb-bug-gnu-emacs@m.gmane.org; Tue, 02 Apr 2013 19:10:38 +0200 Original-Received: from localhost ([::1]:38060 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UN4ir-00030t-32 for geb-bug-gnu-emacs@m.gmane.org; Tue, 02 Apr 2013 13:10:13 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:48787) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UN4im-0002yl-UK for bug-gnu-emacs@gnu.org; Tue, 02 Apr 2013 13:10:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UN4ih-0002Ci-WF for bug-gnu-emacs@gnu.org; Tue, 02 Apr 2013 13:10:08 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:54373) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UN4ih-0002Bg-Tq for bug-gnu-emacs@gnu.org; Tue, 02 Apr 2013 13:10:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1UN4la-00079B-Kr for bug-gnu-emacs@gnu.org; Tue, 02 Apr 2013 13:13:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 02 Apr 2013 17:13:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13864 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 13864-submit@debbugs.gnu.org id=B13864.136492277027449 (code B ref 13864); Tue, 02 Apr 2013 17:13:02 +0000 Original-Received: (at 13864) by debbugs.gnu.org; 2 Apr 2013 17:12:50 +0000 Original-Received: from localhost ([127.0.0.1]:58482 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UN4lN-00078g-S9 for submit@debbugs.gnu.org; Tue, 02 Apr 2013 13:12:50 -0400 Original-Received: from mtaout22.012.net.il ([80.179.55.172]:44836) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UN4lL-00078T-5Q for 13864@debbugs.gnu.org; Tue, 02 Apr 2013 13:12:48 -0400 Original-Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0MKN00E000WCNY00@a-mtaout22.012.net.il> for 13864@debbugs.gnu.org; Tue, 02 Apr 2013 20:09:46 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MKN00EAI1088N90@a-mtaout22.012.net.il>; Tue, 02 Apr 2013 20:09:44 +0300 (IDT) In-reply-to: <861uau6vyd.fsf@chateau.d.if> X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.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:73095 Archived-At: > From: ashish.is@lostca.se (Ashish SHUKLA) > Cc: 13864@debbugs.gnu.org > Date: Mon, 01 Apr 2013 22:15:46 +0530 > > Please refer to the attached output. Thanks, I think we've finally nailed this sucker. > I'm not sure if it's for the right frame (i.e. "garbaged" flag > monitored for X11 frame, or emacsclient frame). It is certainly for the right frame, because the code that sets the "garbaged" flag is here: if (FRAME_TERMCAP_P (XFRAME (frame)) || FRAME_MSDOS_P (XFRAME (frame))) { if (FRAMEP (FRAME_TTY (XFRAME (frame))->top_frame)) /* Mark previously displayed frame as now obscured. */ SET_FRAME_VISIBLE (XFRAME (FRAME_TTY (XFRAME (frame))->top_frame), 2); SET_FRAME_VISIBLE (XFRAME (frame), 1); <<<<<<<<<<<<<<<<<<<<<<<<<<< FRAME_TTY (XFRAME (frame))->top_frame = frame; } As you can see from the condition for this block, it is only run for TTY (a.k.a. "termcap") frames. I think the problem here is that the code sets the "garbaged" flag even if the "top frame" of the TTY did not change at all. Can you try the patch below? Please try it both with a single TTY frame on the xterm (in addition to a GUI frame), like what you did until now, and also with several TTY frames on the same xterm (you can create additional frames by "C-x 5" commands). If this gives good results, I will install it. Thanks. === modified file 'src/frame.c' --- src/frame.c 2013-04-02 01:54:56 +0000 +++ src/frame.c 2013-04-02 17:06:50 +0000 @@ -803,10 +803,18 @@ do_switch_frame (Lisp_Object frame, int if (FRAME_TERMCAP_P (XFRAME (frame)) || FRAME_MSDOS_P (XFRAME (frame))) { - if (FRAMEP (FRAME_TTY (XFRAME (frame))->top_frame)) - /* Mark previously displayed frame as now obscured. */ - SET_FRAME_VISIBLE (XFRAME (FRAME_TTY (XFRAME (frame))->top_frame), 2); - SET_FRAME_VISIBLE (XFRAME (frame), 1); + Lisp_Object top_frame = FRAME_TTY (XFRAME (frame))->top_frame; + + /* Don't mark the frame garbaged and/or obscured if we are + switching to the frame that is already the top frame of that + TTY. */ + if (!EQ (frame, top_frame)) + { + if (FRAMEP (top_frame)) + /* Mark previously displayed frame as now obscured. */ + SET_FRAME_VISIBLE (XFRAME (top_frame), 2); + SET_FRAME_VISIBLE (XFRAME (frame), 1); + } FRAME_TTY (XFRAME (frame))->top_frame = frame; }