unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: ashish.is@lostca.se (Ashish SHUKLA)
Cc: 13864@debbugs.gnu.org
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	[thread overview]
Message-ID: <83wqskj1tz.fsf@gnu.org> (raw)
In-Reply-To: <861uau6vyd.fsf@chateau.d.if>

> 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;
     }
 






  reply	other threads:[~2013-04-02 17:10 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-03 19:19 bug#13864: 24.3.50; emacsclient -t loops when connected to emacs server running in X11 Ashish SHUKLA
2013-03-04 17:50 ` Eli Zaretskii
2013-03-04 19:13   ` Ashish SHUKLA
2013-03-04 20:22     ` Eli Zaretskii
2013-03-05  0:26       ` Ashish SHUKLA
2013-03-06 17:07         ` Eli Zaretskii
2013-03-06 18:52           ` Ashish SHUKLA
2013-03-06 21:00             ` Eli Zaretskii
2013-03-07  1:43               ` Ashish SHUKLA
2013-03-07  6:55                 ` Eli Zaretskii
2013-03-07  7:38                   ` Ashish SHUKLA
2013-03-07  9:16                     ` Eli Zaretskii
2013-03-07 10:19                       ` Ashish SHUKLA
2013-03-07 12:48                         ` Eli Zaretskii
2013-03-08 10:08                           ` Ashish SHUKLA
2013-03-08 15:58                             ` Eli Zaretskii
2013-03-13  9:00                               ` Ashish SHUKLA
2013-03-15  9:39                                 ` Eli Zaretskii
2013-03-22 12:44                                   ` Ashish SHUKLA
2013-03-24 19:54                                     ` Eli Zaretskii
2013-03-25  9:28                                       ` Ashish SHUKLA
2013-03-25 10:56                                         ` Eli Zaretskii
2013-04-01 16:45                                           ` Ashish SHUKLA
2013-04-02 17:10                                             ` Eli Zaretskii [this message]
2013-04-10  9:06                                               ` Ashish SHUKLA
2013-04-10 15:41                                                 ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83wqskj1tz.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=13864@debbugs.gnu.org \
    --cc=ashish.is@lostca.se \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).