From: Eli Zaretskii Date: Wed, 10 Apr 2013 15:38:20 +0000 (+0300) Subject: Fix bug #13864 with flickering of TTY frames in an emacslient session. X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~387^2~2026^2~491 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=f009190abc3a010cc0ad01df81d02585d436ea3d;p=emacs.git Fix bug #13864 with flickering of TTY frames in an emacslient session. src/frame.c (do_switch_frame): Mark the TTY frame we switch to as garbaged only if it is not already the top frame on its TTY. This prevents flickering due to constant redrawing of TTY frames when there are GUI frames open in the same session. --- diff --git a/src/ChangeLog b/src/ChangeLog index 6fdf601fa95..ff6b9508d62 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2013-04-10 Eli Zaretskii + + * frame.c (do_switch_frame): Mark the TTY frame we switch to as + garbaged only if it is not already the top frame on its TTY. This + prevents flickering due to constant redrawing of TTY frames when + there are GUI frames open in the same session. (Bug#13864) + 2013-04-10 Stefan Monnier * keyboard.c (timer_start_idle): Call internal-timer-start-idle instead diff --git a/src/frame.c b/src/frame.c index 2fe398296ed..ccd50122f50 100644 --- a/src/frame.c +++ b/src/frame.c @@ -834,10 +834,18 @@ do_switch_frame (Lisp_Object frame, int track, int for_deletion, Lisp_Object nor 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; }